Hello, I have a code, that executes multiple codes based on the code frequency. For example, if the code "A" frequency is daily, then it will be executed Daily If code "B" frequency is weekly then it will be executed weekly. There are 12 codes, out of which Daily - 5 Weekly - 4 Monthly - 3 My current situation is, if there is one code fails, then SAS stops executing the rest of the code. I want to change it, so that even if one rule fails, SAS should execute the rest of the code and produce output , and a notification should be sent informing which code failed. Sample Code: libname test "/data/DEV/SYS"; %let RUNDATE = &SYSDATE9; %put &rundate.; %put %sysfunc(weekday("&RUNDATE."d)); %put %sysfunc(day("&RUNDATE."d)); PROC PRINTTO LOG=LOG; RUN; %macro run_code(frequency, file_name, output_file); %let file_path = /data/DEV/SYS/CODE; %if ("&frequency." = "Daily") or ("&frequency." = "Weekly" and %sysfunc(weekday("&RUNDATE."d))=1) or ("&frequency" = "Monthly" and %sysfunc(day("&RUNDATE."d))=6) %then %do; %include "&file_path./&file_name."; %put "&frequency."; %put "&file_path./&file_name."; data results; set results test.&output_file. (keep= Name Description Country State); run; %end; %mend run_code; data results; set _NULL_; run; data _NULL_; set test.rule_input; call execute ('%run_code('||TRIM(Frequency)||','||TRIM(SASFILE)||','||TRIM(output_file)||')'); run; proc format; picture date_b_fmt(default=45) low-high='%Y-%0m-%0d %0H:%0M:%0S'(datatype=datetime); run; data test.ALLCust_&RUNDATE.; set results; format run_date date_b_fmt.; format rundate1 date9.; Run_date=datetime(); Rundate1=today(); run; /*END OF CODE*/
... View more