Binnnnn5
Binnnnn5

Reputation: 187

Is there any solutions to write this SAS code into "proc sql" process?

I wrote this code below to complete 2 tasks:

  1. change the value of variable "miscrit" into null if satisfy the condition of "('01JUL2019'd - EXVISDAT + 1) < OverDueDays".
  2. Then delete the columns of targetdays and overduedays from the table.

I wonder if it is possible to write this process with a "proc sql" process since I'm really interested in sql process these days.

Thanks for your help, everyone!

data test4;
    set test3;
    if ('01JUL2019'd - EXVISDAT + 1) < OverDueDays then do;
    miscrit="";
    end;
    drop targetdays overduedays;
run;

I managed to use proc sql to change the value of variable. But don't know how to add the code of the delete of targetdays and overduedays columns from this table.

proc sql;
    update test05
    set miscrit = ""
    where ('01JUL2019'd - EXVISDAT + 1) < OverDueDays
    ;
quit;

Upvotes: 2

Views: 119

Answers (1)

Llex
Llex

Reputation: 1770

Try to use alter table:

proc sql;
    update test05
    set miscrit = ""
    where ('01JUL2019'd - EXVISDAT + 1) < OverDueDays
    ;
    alter table test05
    drop targetdays,overduedays;
quit;

Upvotes: 4

Related Questions