Hello friends - I need help on below logic please!!! I am checking existance of file - if not exist than send email if exist check records and if records r less than certain number then send email... %let testfile='c:\test.txt'; %macro check; /*check file and if file exist take it into sas*/ %if %sysfunc(fileexist(&testfile) %then %do; data work.abc; infile 'c:\test.txt dlm=',' dsd; input name $ id number1; run; %end; /*if not exist then abort and send email*/ %else %do; data _null_; abort return; run; FIlename mymail email "emaild" subject="sas message" to="emailid"; data _null_; file mymail; put "file not exist"; run; %end; /*if exist then use sas dataset created by data step above*/ %else %do; %let dsid=%sysfunc(open(abc)); %let num=%sysfunc(attrn(&dsid,nobs)); %let rc=%sysfunc(close(&dsid)); %put message; %if &num<50000 %then %do; FIlename mymail email "emaild" subject="sas message" to="emailid"; data _null_; file mymail; put "file has less than 50000 records"; run; %end; %else %if &num>50000 %then %do; data _null_; put 'enogh records'; run; %mend; %check; /*but I am getting error about imbalance if then else statement*/ thanks!!!
... View more