I am importing a file using proc import proc import datafile="/opt/Export_d.csv" replace out=work.export_data; run; THEN I SELECTED 2 VARIBLES FROM EXPORTED TABLE HAVING SOME CONDITION proc sql; create table work.login2 as select ' SURVEY_ID'n, TIME format=datetime20.,' USERNAME'n from work.export_data having TIME=max(TIME) and ' USERNAME'="sasdemo"; quit; then i created a macro for survey_id because i have to update a value with the Survey_id reference in different table shown in below code: proc sql; select max(' SURVEY_ID'n) into: sid from work.login2; quit; now if the ID is blank then i dont have to insert anything but if we have survey_id we have update few columns in a table using below code which is not happening. proc sql; case when ' SURVEY_ID'n is not null then update table_name set SAS_TRACKING_CODE="&Trackingcode." where SURVEY_ID=&sid. else end; quit;
... View more