微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在SAS中为不同的first.id分配不同的值

如何解决如何在SAS中为不同的first.id分配不同的值

如何为SAS中的不同first.id分配不同的值。我有一个数据集。数据集非常庞大,我仅在此处显示该部分。赞赏。

const Tab = createBottomTabNavigator();
const tabActiveColor = "#EF2D56";
const tabInActiveColor = "#898A8D";

const BottomTabNavigator = () => {
  return (
    <Tab.Navigator
      initialRouteName="MyNotes"
      screenoptions={({ route }) => ({
        tabBarIcon: ({ focused,color,size }) => {
          let tabIcon = "../assets/notes.png";
          if (route.name === "MyNotes") {
            tabIcon = require("../assets/notes.png");
          } else if (route.name === "Feed") {
            tabIcon = require("../assets/Feed.png");
          } else if (route.name === "discover") {
            tabIcon = require("../assets/decouvrir.png");
          } else if (route.name === "MyProfile") {
            tabIcon = require("../assets/myprofile.png");
          }
          return (
            <Image
              source={tabIcon}
              resizeMode="contain"
              style={{
                height: 26.4,width: 22,tintColor: focused ? tabActiveColor : tabInActiveColor,}}
            />
          );
        },})}
      tabBarOptions={{
        style: { zIndex: 110 },safeAreaInset: { bottom: "never" },activeTintColor: "#000000",}}
    >
      <Tab.Screen
        name="MyNotes"
        component={MyNotes}
        options={{
          tabBarLabel: "Notes",}}
      />
      <Tab.Screen
        name="Feed"
        component={Feed}
        options={{
          tabBarLabel: "Feed",}}
      />
      <Tab.Screen
        name="discover"
        component={discover}
        options={{
          tabBarLabel: "Découvrir",}}
      />
      <Tab.Screen
        name="MyProfile"
        component={MyProfile}
        options={{
          tabBarLabel: "Profil",}}
      />
      <Tab.Screen name="App" component={App} />
    </Tab.Navigator>
  );
};

export default BottomTabNavigator;


const Stack = createStackNavigator();

export default function BottomNavigation() {
  return (
    <NavigationContainer independent={true}>
      <BottomTabNavigator />
    </NavigationContainer>
  );
}

我需要的是这个

id
11
11
11
11
22
22
22
22
33
33

解决方法

假设每个ID在单独的数据集中有一个值,则可以MERGE BY ID并将val重置为0

示例:

data have;
input id @@; datalines;
11 11 11 11
22 22 22 22
33 33
;

data values;
input id val; datalines;
11 5
22 8
33 9
;

data want;
  merge have values;
  by id;
  if not first.id then val = 0;
run;

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。