利用if判断+output的选项实现该功能。

 1 data mysas.mmsuser_dec mysas.mmsuser_nov mysas.mmsuser_other;
 2     infile 'E:\SAS\mysas\mmsuser.txt' dlm='09'x firstobs=2;
 3     input date $ city $ a b c d;
 4     if date='201211' then output mysas.mmsuser_dec;
 5     else if date='201212' then output mysas.mmsuser_nov;
 6     else output mysas.mmsuser_other;
 7 run;
 8 proc print data=mysas.mmsuser_dec;
 9 run;
10 proc print data=mysas.mmsuser_nov;
11 run;
12 proc print data=mysas.mmsuser_other;
13 run;

只要在sas写入数据集的过程中都可以使用output来控制输出。

 

相关文章:

  • 2021-07-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-02-16
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案