Skip to content

Commit

Permalink
fix: adding quit statement so that exit loop would work on step boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
allanbowe committed Jan 21, 2021
1 parent efc731c commit 82184bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion all.sas
Original file line number Diff line number Diff line change
Expand Up @@ -4782,6 +4782,7 @@ proc sql
%local lib dir ds1 ds2 ds3 start_tm i;
%let start_tm=%sysfunc(datetime());
%let duration=%sysevalf(&duration);
/* create a temporary library in WORK */
%let lib=%mf_getuniquelibref();
Expand Down Expand Up @@ -4809,7 +4810,7 @@ libname &lib "%sysfunc(pathname(work))/&dir";
proc summary ;
class randnum0 randnum1;
output out=&lib..&ds2;
run;
run;quit;
%if %sysevalf( (%sysfunc(datetime())-&start_tm)>&duration ) %then %goto gate;
/* add more data */
Expand All @@ -4818,6 +4819,7 @@ libname &lib "%sysfunc(pathname(work))/&dir";
select *, ranuni(0)*10 as randnum2
from &lib..&ds1
order by randnum1;
quit;
%if %sysevalf( (%sysfunc(datetime())-&start_tm)>&duration ) %then %goto gate;
proc sort data=&lib..&ds3;
Expand Down
4 changes: 3 additions & 1 deletion base/mp_testjob.sas
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
%local lib dir ds1 ds2 ds3 start_tm i;

%let start_tm=%sysfunc(datetime());
%let duration=%sysevalf(&duration);

/* create a temporary library in WORK */
%let lib=%mf_getuniquelibref();
Expand Down Expand Up @@ -53,7 +54,7 @@ libname &lib "%sysfunc(pathname(work))/&dir";
proc summary ;
class randnum0 randnum1;
output out=&lib..&ds2;
run;
run;quit;
%if %sysevalf( (%sysfunc(datetime())-&start_tm)>&duration ) %then %goto gate;

/* add more data */
Expand All @@ -62,6 +63,7 @@ libname &lib "%sysfunc(pathname(work))/&dir";
select *, ranuni(0)*10 as randnum2
from &lib..&ds1
order by randnum1;
quit;
%if %sysevalf( (%sysfunc(datetime())-&start_tm)>&duration ) %then %goto gate;

proc sort data=&lib..&ds3;
Expand Down

0 comments on commit 82184bc

Please sign in to comment.