BookmarkSubscribeRSS Feed
Jamie_H
Fluorite | Level 6

Morning all,

 

I have some EG code that starts with a prompt window for the user to select items, then runs through c.10 program nodes, before creating an ODS Excel Output and saving to the network using the Copy Files Add-In.

 

This is all fine for one off runs of the code, but each month we need to run the code around 50 times manually, selecting a different set of prompts for each run before waiting for the output to be saved to the network and repeating again.

 

My question is, how would people go about automating this sort of report?  I could have a input file that holds details of the Prompts for each run and have SAS read that in, and then use those inputs to generate th report, but how would you get SAS to go back to the first node of the program?  How would you bypass the prompt selection coming up?  Does it need to be a standalone program in itself, instead of messing with the more manual version of the code?

 

Just looking for thoughts on the process from anyone who may have had to face into this.

 

Many thanks

Jamie

3 REPLIES 3
SASKiwi
PROC Star

One way would be to make use of CALL EXECCMD. Create a prompt dataset with one row for each prompt and program run. Define each prompt as a macro variable that is then used in the program being included.

 

data _null_;
  set PromptData;
  call execcmd('%let prompt1 = ' !! prompt1 !! '; %include "MyProgram.sas";');
run;
Jamie_H
Fluorite | Level 6

Thanks SASKiwi.  I havent seen CALL EXECCMD before but it looks interesting so will look into that. 

 

At the moment, because of our SAS Install, the server cannot see the Network Drives where the sas code is stored, so i'm not sure I could do a %Include to the code.  Also, because it's in Enterprise Guide, how would I tell it which node of the code to start running from?

 

Cheers

SASKiwi
PROC Star

Well I'm assuming you know which part of your EG project needs repeating. You could export that part of your project out of EG to a SAS program and store it in a location accessible by your SAS server.

 

Judging by your requirements, I suggest a coded solution would be better for this type of automation. 

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3 replies
  • 950 views
  • 0 likes
  • 2 in conversation