08-18-2012 12:32 PM
How to execute %include statements based on data set existence in each % include. If data set does not exist in current %include then program has to terminate and trigger a mail as job failure.
Thanks for your suggestions.
08-18-2012 03:02 PM
You will get a more complete and probably better answer if you explain more about what you are trying to do, but you can always wrap your desired checks and logic into a macro. e.g.:
%if %sysfunc(exist(work.test)) %then %do;
%if &continue. and %sysfunc(exist(work.have)) %then %do;
%if not(&continue) %then %do;
put #3 @10 "Data set does not exist";
As for the code to send an email, take a look at: http://support.sas.com/kb/19/767.html
08-19-2012 03:09 AM
In this program data is processing from one include statement to other include statement (i.e output of first include is an input for second include statement) and finally creates out files with correct data. If any one of the include statement doesn't run properly the final output files has not updated with correct data. so am looking for checkpoints at each include while executing the program.
08-19-2012 08:50 AM
Unless I misunderstand what you are trying to accomplish, that is what the suggested code does. However, it was only written for 2 includes and you would have to expand it for however many you actually have.