From 469bd574acae8f90d8dd0373c04ff56ce82a52b0 Mon Sep 17 00:00:00 2001 From: munja Date: Wed, 29 Dec 2021 12:35:25 +0000 Subject: [PATCH] fix: removing 'Log Extract' from abort MSG in mp_abort when not capturing the log --- all.sas | 7 +++++-- base/mp_abort.sas | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/all.sas b/all.sas index be7b4d4..4069d15 100644 --- a/all.sas +++ b/all.sas @@ -2135,8 +2135,8 @@ Usage: %if %symexist(SYSPRINTTOLOG) %then %let logloc=&SYSPRINTTOLOG; %else %let logloc=%qsysfunc(getoption(LOG)); proc printto log=log;run; + %let logline=0; %if %length(&logloc)>0 %then %do; - %let logline=0; data _null_; infile &logloc lrecl=5000; input; putlog _infile_; @@ -2185,7 +2185,10 @@ Usage: file _webout mod lrecl=32000 encoding='utf-8'; length msg $32767 ; sasdatetime=datetime(); - msg=cats(symget('msg'),'\n\nLog Extract:\n',symget('logmsg')); + msg=symget('msg'); + %if &logline>0 %then %do; + msg=cats(msg,'\n\nLog Extract:\n',symget('logmsg')); + %end; /* escape the quotes */ msg=tranwrd(msg,'"','\"'); /* ditch the CRLFs as chrome complains */ diff --git a/base/mp_abort.sas b/base/mp_abort.sas index dd4d500..48ed281 100644 --- a/base/mp_abort.sas +++ b/base/mp_abort.sas @@ -110,8 +110,8 @@ %if %symexist(SYSPRINTTOLOG) %then %let logloc=&SYSPRINTTOLOG; %else %let logloc=%qsysfunc(getoption(LOG)); proc printto log=log;run; + %let logline=0; %if %length(&logloc)>0 %then %do; - %let logline=0; data _null_; infile &logloc lrecl=5000; input; putlog _infile_; @@ -160,7 +160,10 @@ file _webout mod lrecl=32000 encoding='utf-8'; length msg $32767 ; sasdatetime=datetime(); - msg=cats(symget('msg'),'\n\nLog Extract:\n',symget('logmsg')); + msg=symget('msg'); + %if &logline>0 %then %do; + msg=cats(msg,'\n\nLog Extract:\n',symget('logmsg')); + %end; /* escape the quotes */ msg=tranwrd(msg,'"','\"'); /* ditch the CRLFs as chrome complains */