G'day!
I'm trying to convert MS Access SQL Query code someone left in to SAS Code.
Here's the code in MS Access:
SELECT TABLE1.STATUS AS IntStatus,
IIf([VAR1DOSENUM]=4 And [STARTDATE]-[LASTVAR1]<170,"COND",
IIf([VAR1DOSENUM]=3 And [STARTDATE]-[LASTVAR1]<170,"COND",
IIf([VAR1DOSENUM]=2 And [STARTDATE]-[LASTVAR1]<20,"COND",
IIf([VAR1DOSENUM]=1 And [STARTDATE]-[LASTVAR1]<20,"COND",
"NOT_UTD"))))
AS FinStatus_D
FROM TABLE1 INNER JOIN TABLE5 TABLE1.ID = TABLE5.ID;
______________________________________________
I've pasted my unsuccessful SAS code (not getting errors in log. Just not getting same # of "COND" and "NOT_UTD" as expected for VAR1) below
Any help you can give is much appreciated!!
data table6;
set table5;
*--define int_status;
int_status=status;
*--define cond or not_utd for var1;
if var1dosenum=4 and (startdate-lastvar1<170) then finstatus_d="COND";
else if var1dosenum=3 and startdate-lastvar1<170 then finstatus_d="COND";
else if var1dosenum=2 and startdate-lastvar1<20 then finstatus_d="COND";
else if var1dosenum=1 and startdate-lastvar1<20 then finstatus_d="COND";
else finstatus_d="NOT_UTD";
run;
Thank you!
... View more