【问题标题】:Data step issue in sas enterprise guidesas企业指南中的数据步骤问题
【发布时间】:2020-06-21 09:51:51
【问题描述】:

我需要在 sas 中编写数据步骤查询,我需要为从特定数字开始的列提供序列号。

例如,现在我的表格如下所示:

Column 1   Column 2
abc         book1
xyz         book2
zex         book3

我希望我的桌子看起来像这样:

Column 1   Column 2    Column3
abc         book1      151   
xyz         book2      152
zex         book3      153

如何在Column 3中添加一个从特定数字开始的序列号?

【问题讨论】:

    标签: sas


    【解决方案1】:

    这个怎么样

    data have;
    input Column1 $ Column2 $;
    datalines;
    abc         book1
    xyz         book2
    zex         book3
    ;
    
    data want;
       do Column3 = 150 by 1 until (lr);
          set have end=lr;
          output;
       end;
    run;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-07-07
      • 1970-01-01
      • 2017-03-29
      • 2021-02-01
      • 1970-01-01
      • 2015-07-05
      • 1970-01-01
      相关资源
      最近更新 更多