Hi RW9, This is a very helpful way to optimize my code. But we want to know if this scenario is possible. I have 3 jobs running using a loop statement. Iteration1: Job1 is successful. Iteration2: Job2 is unsuccessful. Since we don't have an error handling. The macro continued to Iteration3. The result is: Iteration3: Job2 is unsuccessful. Instead of running Job3. The 3rd iteration still ran Job2. Please see log below: JOB1: SYMBOLGEN: Macro variable JOB_ITER resolves to 1 NOTE: JOBNAME = Extract_Transaction_IM MPRINT(CALL_EXTRACT_JOBS): data _null_; SYMBOLGEN: Macro variable PAR resolves to Extract_Transaction_IM,Extract_Cash_Flow_Fact_IM,Extract_Bank_IM,Extract_Other_Parties_IM SYMBOLGEN: Macro variable JOB_ITER resolves to 1 MPRINT(CALL_EXTRACT_JOBS): call symputx("etls_job",strip(scan("Extract_Transaction_IM,Extract_Cash_Flow_Fact_IM,Extract_Bank_IM,Extract_Other_Parties_IM",1,","))); MPRINT(CALL_EXTRACT_JOBS): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds SYMBOLGEN: Macro variable ETLS_JOB resolves to Extract_Transaction_IM NOTE: %INCLUDE (level 1) file EXT_JOBS(Extract_Transaction_IM.sas) is file JOB2: MLOGIC(CALL_EXTRACT_JOBS): %DO loop index variable JOB_ITER is now 2; loop will iterate again. MLOGIC(CALL_EXTRACT_JOBS): %PUT NOTE: JOBNAME = %sysfunc(scan("&PAR",&job_iter,",")) SYMBOLGEN: Macro variable PAR resolves to Extract_Transaction_IM,Extract_Cash_Flow_Fact_IM,Extract_Bank_IM,Extract_Other_Parties_IM SYMBOLGEN: Macro variable JOB_ITER resolves to 2 NOTE: JOBNAME = Extract_Cash_Flow_Fact_IM MPRINT(CALL_EXTRACT_JOBS): data _null_; SYMBOLGEN: Macro variable PAR resolves to Extract_Transaction_IM,Extract_Cash_Flow_Fact_IM,Extract_Bank_IM,Extract_Other_Parties_IM SYMBOLGEN: Macro variable JOB_ITER resolves to 2 MPRINT(CALL_EXTRACT_JOBS): call symputx("etls_job",strip(scan("Extract_Transaction_IM,Extract_Cash_Flow_Fact_IM,Extract_Bank_IM,Extract_Other_Parties_IM",2,","))); 137 The SAS System 10:06 Wednesday, May 7, 2014 MPRINT(CALL_EXTRACT_JOBS): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds SYMBOLGEN: Macro variable ETLS_JOB resolves to Extract_Cash_Flow_Fact_IM NOTE: %INCLUDE (level 1) file EXT_JOBS(Extract_Cash_Flow_Fact_IM.sas) is file JOB2 ERROR: MLOGIC(CALL_EXTRACT_JOBS): %PUT ERROR: Job &gcPProd did not end successfully. SYMBOLGEN: Macro variable GCPPROD resolves to CASH_FLOW_FACT_IM ERROR: Job CASH_FLOW_FACT_IM did not end successfully. JOB3: MLOGIC(CALL_EXTRACT_JOBS): %DO loop index variable JOB_ITER is now 3; loop will iterate again. MLOGIC(CALL_EXTRACT_JOBS): %PUT NOTE: JOBNAME = %sysfunc(scan("&PAR",&job_iter,",")) SYMBOLGEN: Macro variable PAR resolves to Extract_Transaction_IM,Extract_Cash_Flow_Fact_IM,Extract_Bank_IM,Extract_Other_Parties_IM SYMBOLGEN: Macro variable JOB_ITER resolves to 3 NOTE: JOBNAME = Extract_Bank_IM MPRINT(CALL_EXTRACT_JOBS): data _null_; SYMBOLGEN: Macro variable PAR resolves to Extract_Transaction_IM,Extract_Cash_Flow_Fact_IM,Extract_Bank_IM,Extract_Other_Parties_IM SYMBOLGEN: Macro variable JOB_ITER resolves to 3 MPRINT(CALL_EXTRACT_JOBS): call symputx("etls_job",strip(scan("Extract_Transaction_IM,Extract_Cash_Flow_Fact_IM,Extract_Bank_IM,Extract_Other_Parties_IM",3,","))); MPRINT(CALL_EXTRACT_JOBS): run; NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds SYMBOLGEN: Macro variable ETLS_JOB resolves to Extract_Cash_Flow_Fact_IM NOTE: %INCLUDE (level 1) file EXT_JOBS(Extract_Cash_Flow_Fact_IM.sas) is file Thanks!!!
... View more