Hi, CHECKMASTER is a work table which contains attached data. I want to execute the SH jobs one by one in a loop through a table when val = 0 and runstatus = N . Then I want to set the runstatus as 'P' using update_status macro. But the condition is always false . Also, I am not too sure if my call execute statement to include a sas code is correct . Kindly advise why the condition is always false and if my call execute statement to include a sas code is correct I am using LINUX Environment . SAS Version is 4.4 . Below is the code: %macro update_status(status=); proc sql; update exeng.EngineExecution set runstatus="&status" where JobName=compress("&&jobs&cnt_h"); quit; %mend update_status; %macro jobex; %let path=/app/scripts/batch; %let extn=sh; %global cnt_h; %global jobs; proc sql; select count(jobname) into :cnt_h separated by ' ' from CHECK_MASTER ; select jobname into :jobs1-:jobs%left(&cnt_h) from CHECK_MASTER; quit; data _null_; set work.CHECK_MASTER; /*call symputx ("val",val);*/ /*call symputx ("runstatus",runstatus);*/ %do i=1 %to &cnt_h; %if ((val=0) AND (Runstatus = 'F' or RUNSTATUS='N' )) %then %do; call execute('%include "&path./&&jobs&i...&extn"'); /*x "&path/&&jobs&i...&extn";*/ status="P"; %update_status(status); %end;x %end; run; %mend jobex; %jobex; Log: MPRINT(JOBEX): data _null_; MPRINT(JOBEX): set work.CHECK_MASTER; SYMBOLGEN: Macro variable CNT_H resolves to 9 MLOGIC(JOBEX): %DO loop beginning; index variable I; start value is 1; stop value is 9; by value is 1. MLOGIC(JOBEX): %IF condition ((val=0) AND (Runstatus = 'F' or RUNSTATUS='N' )) is FALSE Thanks, Sandhya S
... View more