From e6146dcbcf939d78574b0b6618c12bbe0bfb105f Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Tue, 11 May 2021 12:39:10 +0300 Subject: [PATCH] fix: more logic to improve robustness --- base/mp_abort.sas | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/base/mp_abort.sas b/base/mp_abort.sas index 05bb339..19ae598 100644 --- a/base/mp_abort.sas +++ b/base/mp_abort.sas @@ -24,6 +24,8 @@ %macro mp_abort(mac=mp_abort.sas, type=, msg=, iftrue=%str(1=1) )/*/STORE SOURCE*/; + %global sysprocessmode sysprocessname; + %if not(%eval(%unquote(&iftrue))) %then %return; %put NOTE: /// mp_abort macro executing //; @@ -31,9 +33,7 @@ %put NOTE - &msg; /* Stored Process Server web app context */ - %if %symexist(_metaperson) - or (%symexist(SYSPROCESSNAME) and "&SYSPROCESSNAME"="Compute Server" ) - %then %do; + %if %symexist(_metaperson) or "&SYSPROCESSNAME"="Compute Server" %then %do; options obs=max replace nosyntaxcheck mprint; /* extract log errs / warns, if exist */ %local logloc logline; @@ -128,14 +128,13 @@ if debug ge '"131"' then put '>>weboutEND<<'; run; - data _null_; - if symexist('sysprocessmode') then - if symget("sysprocessmode")="SAS Stored Process Server" then do; - putlog 'stpsrvset program error and syscc'; - rc=stpsrvset('program error', 0); - call symputx("syscc",0,"g"); - end; - run; + %if "&sysprocessmode " = "SAS Stored Process Server " %then %do; + data _null_; + putlog 'stpsrvset program error and syscc'; + rc=stpsrvset('program error', 0); + call symputx("syscc",0,"g"); + run; + %end; %if "%substr(&sysvlong.xxxxxxx,1,9)" ne "9.04.01M3" %then %do; %put NOTE: Ending SAS session due to:; @@ -154,7 +153,10 @@ filename skip temp; data _null_; file skip; - put '%macro skip(); %macro skippy();'; + put '%macro skip();'; + comment '%mend skip; -> fix lint '; + put '%macro skippy();'; + comment '%mend skippy; -> fix lint '; run; %inc skip; %end;