BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tushh
Calcite | Level 5

1) How to call .exe file in SAS 9.4? OR SAS Enterprise Guide?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

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.

View solution in original post

5 REPLIES 5
LinusH
Tourmaline | Level 20

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.

Data never sleeps
DanielSantos
Barite | Level 11

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

 

Kurt_Bremser
Super User

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.

Tushh
Calcite | Level 5
Thank U
Tushh
Calcite | Level 5

Thank U

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 3530 views
  • 2 likes
  • 4 in conversation