No... This should work With Your Version too. This functionality is VERY old.
You will get a "balnk" value when running interactively and the full pathname of the log file when running in batch mode (where there is a log file).
... I think you replied to another aswer than mine....
TRY IT!
If these macro variables only exist in batch mode, then that fact should be part of the documentation.
Yes, this is batch things...
@PSNn wrote:
Yes, this is batch things...
See my other post. Tested it in workspace server, display manager and batch. Same result everywhere.
I'm considering opening a track with SAS TS. Either the documentation is incomplete, or something else is fishy.
Ran this:
%put %symexist(SYSPRINTTOLOG);
proc printto log='$HOME/log1.txt' new;run;
%put %symexist(SYSPRINTTOLOG);
%put &SYSPRINTTOLOG;
proc printto log='$HOME/log2.txt' new;run;
%put %symexist(SYSPRINTTOLOG);
%put &SYSPRINTTOLOG;
proc printto;run;
%put %symexist(SYSPRINTTOLOG);
%put &SYSPRINTTOLOG;
%put &=sysvlong;
And got this log in EG:
24 %put %symexist(SYSPRINTTOLOG); 0 25 proc printto log='$HOME/log1.txt' new;run; NOTE: PROZEDUR PRINTTO used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 32 %put %symexist(SYSPRINTTOLOG); 0 33 %put &SYSPRINTTOLOG; WARNING: Apparent symbolic reference SYSPRINTTOLOG not resolved. &SYSPRINTTOLOG 34 %put &=sysvlong; SYSVLONG=9.04.01M2P072314
log1.txt:
NOTE: PROZEDUR PRINTTO used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 26 %put %symexist(SYSPRINTTOLOG); 0 27 %put &SYSPRINTTOLOG; WARNING: Apparent symbolic reference SYSPRINTTOLOG not resolved. &SYSPRINTTOLOG 28 proc printto log='$HOME/log2.txt' new;run;
log2.txt:
NOTE: PROZEDUR PRINTTO used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 29 %put %symexist(SYSPRINTTOLOG); 0 30 %put &SYSPRINTTOLOG; WARNING: Apparent symbolic reference SYSPRINTTOLOG not resolved. &SYSPRINTTOLOG 31 proc printto;run;
SAS on AIX, so this might be specific to the OS.
Edit:
Ran the same in batch mode, identical result. Maybe there's an option that disables this?
Yes... An explanation from SAS Institute is needed..
This document: http://support.sas.com/resources/papers/proceedings15/SAS1575-2015.pdf
is pretty old and says that this shouyld be available in both 9.3 and 9.4
I'm using SAS UE that is sas 9.4.
I opened a track with SAS TS. It's 7612261829.
Thank you so much for your help, I really appreciate it
Got an answer. The functionality seems to have been added to _all_ platforms with 9.4M3. I'm on 9.4M2.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.