mirror of
https://github.com/sasjs/core.git
synced 2026-01-08 18:00:06 +00:00
fix: mp_abort cleanup
This commit is contained in:
27
all.sas
27
all.sas
@@ -1748,19 +1748,26 @@ Usage:
|
|||||||
if debug ge '"131"' then put '>>weboutEND<<';
|
if debug ge '"131"' then put '>>weboutEND<<';
|
||||||
run;
|
run;
|
||||||
|
|
||||||
%if %symexist(_metaport) %then %do;
|
data _null_;
|
||||||
data _null_;
|
if symexist('sysprocessmode') then
|
||||||
if symexist('sysprocessmode') then
|
if symget("sysprocessmode")="SAS Stored Process Server" then do;
|
||||||
if symget("sysprocessmode")="SAS Stored Process Server" then do;
|
putlog 'stpsrvset program error and syscc';
|
||||||
rc=stpsrvset('program error', 0);
|
rc=stpsrvset('program error', 0);
|
||||||
call symputx("syscc",0,"g");
|
call symputx("syscc",0,"g");
|
||||||
end;
|
end;
|
||||||
run;
|
run;
|
||||||
|
%if "%substr(&sysvlong.xxxxxxx,1,9)" ne "9.04.01M3" %then %do;
|
||||||
|
%put NOTE: Ending SAS session due to:;
|
||||||
|
%put NOTE- &msg;
|
||||||
|
endsas;
|
||||||
%end;
|
%end;
|
||||||
|
SYSVLONG=9.04.01M7P080520
|
||||||
/**
|
/**
|
||||||
* endsas is reliable but kills some deployments.
|
* endsas is reliable but kills 9.4m3 deployments by hanging multibridges.
|
||||||
* Abort variants are ungraceful (non zero return code)
|
* Abort variants are ungraceful (non zero return code)
|
||||||
* This approach lets SAS run silently until the end :-)
|
* This approach lets SAS run silently until the end :-)
|
||||||
|
* Caution - fails when called within a %include within a macro
|
||||||
|
* See tests/mp_abort.test.1 for an example case.
|
||||||
*/
|
*/
|
||||||
%put _all_;
|
%put _all_;
|
||||||
filename skip temp;
|
filename skip temp;
|
||||||
@@ -1774,7 +1781,7 @@ Usage:
|
|||||||
%put _all_;
|
%put _all_;
|
||||||
%abort cancel;
|
%abort cancel;
|
||||||
%end;
|
%end;
|
||||||
%mend;
|
%mend mp_abort;
|
||||||
|
|
||||||
/** @endcond *//**
|
/** @endcond *//**
|
||||||
@file
|
@file
|
||||||
|
|||||||
@@ -128,19 +128,26 @@
|
|||||||
if debug ge '"131"' then put '>>weboutEND<<';
|
if debug ge '"131"' then put '>>weboutEND<<';
|
||||||
run;
|
run;
|
||||||
|
|
||||||
%if %symexist(_metaport) %then %do;
|
data _null_;
|
||||||
data _null_;
|
if symexist('sysprocessmode') then
|
||||||
if symexist('sysprocessmode') then
|
if symget("sysprocessmode")="SAS Stored Process Server" then do;
|
||||||
if symget("sysprocessmode")="SAS Stored Process Server" then do;
|
putlog 'stpsrvset program error and syscc';
|
||||||
rc=stpsrvset('program error', 0);
|
rc=stpsrvset('program error', 0);
|
||||||
call symputx("syscc",0,"g");
|
call symputx("syscc",0,"g");
|
||||||
end;
|
end;
|
||||||
run;
|
run;
|
||||||
|
%if "%substr(&sysvlong.xxxxxxx,1,9)" ne "9.04.01M3" %then %do;
|
||||||
|
%put NOTE: Ending SAS session due to:;
|
||||||
|
%put NOTE- &msg;
|
||||||
|
endsas;
|
||||||
%end;
|
%end;
|
||||||
|
SYSVLONG=9.04.01M7P080520
|
||||||
/**
|
/**
|
||||||
* endsas is reliable but kills some deployments.
|
* endsas is reliable but kills 9.4m3 deployments by hanging multibridges.
|
||||||
* Abort variants are ungraceful (non zero return code)
|
* Abort variants are ungraceful (non zero return code)
|
||||||
* This approach lets SAS run silently until the end :-)
|
* This approach lets SAS run silently until the end :-)
|
||||||
|
* Caution - fails when called within a %include within a macro
|
||||||
|
* See tests/mp_abort.test.1 for an example case.
|
||||||
*/
|
*/
|
||||||
%put _all_;
|
%put _all_;
|
||||||
filename skip temp;
|
filename skip temp;
|
||||||
@@ -154,6 +161,6 @@
|
|||||||
%put _all_;
|
%put _all_;
|
||||||
%abort cancel;
|
%abort cancel;
|
||||||
%end;
|
%end;
|
||||||
%mend;
|
%mend mp_abort;
|
||||||
|
|
||||||
/** @endcond */
|
/** @endcond */
|
||||||
28
tests/base/mp_abort.test.1.sas
Normal file
28
tests/base/mp_abort.test.1.sas
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
/**
|
||||||
|
@file
|
||||||
|
@brief Testing mp_abort macro
|
||||||
|
@details This is an unfixed problem with mp_abort. When called from within
|
||||||
|
a macro, within a %include, and that macro contains subsequent logic, the
|
||||||
|
service does not end cleanly - rather, we see:
|
||||||
|
|
||||||
|
ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.
|
||||||
|
ERROR: The macro TEST will stop executing.
|
||||||
|
|
||||||
|
<h4> SAS Macros </h4>
|
||||||
|
@li mp_abort.sas
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
%macro test();
|
||||||
|
|
||||||
|
filename blah temp;
|
||||||
|
data _null_;
|
||||||
|
file blah;
|
||||||
|
put '%mp_abort();';
|
||||||
|
run;
|
||||||
|
%inc blah;
|
||||||
|
|
||||||
|
%if 1=1 %then %put Houston - we have a problem here;
|
||||||
|
%mend test;
|
||||||
|
|
||||||
|
%test()
|
||||||
Reference in New Issue
Block a user