全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2147 2
2016-04-29
data a2;
        length fl $1.;
        do i=1 to 10;
                id=i;
                salary=1000*i;
                output;
        end;

        if salary<5000 then fl='Y';
run;
上面程序中, "if salary<5000 then fl='Y';"没有起作用, 如果另开一个data步,单独放"if salary<5000 then fl='Y'"就会起作用. 发现在同一个data步中跟在"output;"后面的code都不会起作用.
请教各位, 有知道原因或者知道在哪方面着手可以找到原因的吗? 多谢了!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2016-4-29 14:50:02
The OUTPUT statement is an instruction for SAS to write out an observation to the
output data set. An output usually occurs automatically at the bottom of the DATA step.
But here, you want to output an observation each time you compute a new Total. When
you include an OUTPUT statement anywhere in a DATA step, SAS does not execute an
automatic output at the bottom of the DATA step.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-4-29 15:18:06
建议楼主看一下SAS运行的PDV过程~希望有对你有帮助
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群