1) How to call .exe file in SAS 9.4? OR SAS Enterprise Guide?
To expand on @DanielSantos's example, I'd use this:
data _null_;
infile '<myfile.exe> 2>&1' pipe;
input; * read from output;
putlog _infile_; * show it in the log;
run;
The 2>&1 reroutes stderr output to stdout, and so all messages are caught and written to the log.
Be aware that you may not be able to do this (or use any of the suggestions) if your SAS workspace server runs on a different machine or even on a different operating system.
Call execute, call system or X statement.
For Enterprise Guide (or any other workspace server enabled SAS session), you need ALLOWXCMD option to be set.
Hi.
In addition and if you want to retrieve the output of that command you could use the pipe feature.
data _null_;
infile '<myfile.exe>' pipe;
input; * read from output;
putlog _infile_; * show it in the log;
run;
Daniel Santos @ www.cgd.pt
To expand on @DanielSantos's example, I'd use this:
data _null_;
infile '<myfile.exe> 2>&1' pipe;
input; * read from output;
putlog _infile_; * show it in the log;
run;
The 2>&1 reroutes stderr output to stdout, and so all messages are caught and written to the log.
Be aware that you may not be able to do this (or use any of the suggestions) if your SAS workspace server runs on a different machine or even on a different operating system.
Thank U
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.