我在下面编写了这段代码来完成 2 个任务:
- 如果满足“('01JUL2019'd - EXVISDAT + 1) < OverDueDays”条件,则将变量“miscrit”的值更改为 null。
- 然后从表中删除目标天数和逾期天数列。
我想知道是否可以用“proc sql”过程来编写这个过程,因为这些天我对sql过程非常感兴趣。
谢谢大家的帮助!
data test4;
set test3;
if ('01JUL2019'd - EXVISDAT + 1) < OverDueDays then do;
miscrit="";
end;
drop targetdays overduedays;
run;
我设法使用 proc sql 来更改变量的值。但不知道如何添加从该表中删除 targetdays 和 overduedays 列的代码。
proc sql;
update test05
set miscrit = ""
where ('01JUL2019'd - EXVISDAT + 1) < OverDueDays
;
quit;
最佳答案
尝试使用alter table :
proc sql;
update test05
set miscrit = ""
where ('01JUL2019'd - EXVISDAT + 1) < OverDueDays
;
alter table test05
drop targetdays,overduedays;
quit;
关于sql - 有什么解决方案可以将此 SAS 代码写入 "proc sql"进程吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57091531/