09-01-2015
jayr87
SAS Employee
Member since
11-17-2013
- 6 Posts
- 0 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by jayr87
Subject Views Posted 2361 05-12-2014 09:55 PM 2361 05-12-2014 09:53 PM 2397 05-12-2014 03:58 AM 2397 05-09-2014 02:33 AM 2397 05-08-2014 06:10 AM 2747 05-08-2014 04:47 AM -
Activity Feed for jayr87
- Posted Re: Macro variable resolves the same value in a do loop on SAS Programming. 05-12-2014 09:55 PM
- Posted Re: Macro variable resolves the same value in a do loop on SAS Programming. 05-12-2014 09:53 PM
- Posted Re: Macro variable resolves the same value in a do loop on SAS Programming. 05-12-2014 03:58 AM
- Posted Re: Macro variable resolves the same value in a do loop on SAS Programming. 05-09-2014 02:33 AM
- Posted Re: Macro variable resolves the same value in a do loop on SAS Programming. 05-08-2014 06:10 AM
- Posted Macro variable resolves the same value in a do loop on SAS Programming. 05-08-2014 04:47 AM
05-12-2014
09:55 PM
Hi Astounding, Will the marcovar &z resolved to job3? %if &syserr=0 %then %do; %include "&z.sas"; %end; Thanks! Jayr
... View more
05-12-2014
09:53 PM
Hi Jaap, Thank you for this. Our objective is for the 3rd job to run even though the 2nd job erred. How can we do this? Thanks! Jayr
... View more
05-12-2014
03:58 AM
Hi jwillis, Yes the &gcpprod was resolve. Please see below. But this macro is not globally declared through out the job. It is only declared in CASH_FLOW_FACT_IM.sas SYMBOLGEN: Macro variable GCPPROD resolves to CASH_FLOW_FACT_IM ERROR: Job CASH_FLOW_FACT_IM did not end successfully. Regards, Jayr
... View more
05-09-2014
02:33 AM
Hi Tom/Jap, This was the error we encountered on Job2/Iteration2. ERROR: The function ABS referenced by the %SYSFUNC or %QSYSFUNC macro function has too few arguments. Are you saying because of this error.The data step to put Job3 in a macro variable in Iteration3 will not run, therefore Iteration3 will still run the previous value of the macro variable which is job2?
... View more
05-08-2014
06:10 AM
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
05-08-2014
04:47 AM
Hi, I'm trying to replicate an error I encountered. I encountered a syntax error while running a macro. What the macro does was to run different jobs using a do loop. A macro variable was assign to contain all the jobs separated by a comma. Job1 was successfull but Job2 encountered an error. Since I don't have an error handling that will make the macro code to stop after Job2 erred. It should continue to run the other jobs(job3...jobN) But based on the log. The remaining iterations only ran job2 until the loop and the macro was done running. Is there a way that I can replicate my error using the code below? %macro x; %let cnt = 3; %let s = job1,job2,job3; %do i = 1 %to &cnt; %put note: %sysfunc(scan("&s",&i,",")); data _null_; call symputx('z',scan("&s",&i,",")); run; %include "&z..sas"; %put &z; %end; %mend; %x;
... View more