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

I have many SAS EG projects, all of which require the user to fill in a number of prompts prior to running.  Leadership wants to automate these instead of needing a human to run the projects and fill in the prompts.  is it possible to run these prompt-dependent projects using PowerShell, and if so, where to begin?  I have never used PowerShell.

 

Note, I have seen other postings confirming that PowerShell can run SAS EG projects, but I have seen nothing on whether PowerShell can run projects that require prompts to be filled in.  Please advise, and thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

You can technically use EG automation to script prompt values.  These are ProjectParameter objects in the automation model, and you get that list from the Project object.  

 

However, others are correct that if you want this to scale in a batch run, it might be easier to just set macro variables and/or environment values for your SAS programs to pick up.  But if your prompts are encoded in tasks, like the Query Builder, then the Project.Parameters property will get you the list.  You can then set the Value attribute on each ProjectParameter object.

 

 

 

 

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

View solution in original post

4 REPLIES 4
Kurt_Bremser
Super User

From where would you get those values needed to be entered in these prompts?

 

To automate a SAS job, the usual method is to create a .sas file containing the program, and having the program read parameters either from the commandline (SYSPARM) or from environment variables. The .sas file is then run as a a batch program. Environment variables are used when schedulers run SAS jobs.

saslover15
Obsidian | Level 7
"From where would you get those values needed to be entered in these prompts?" That's what I am wondering - can it be done, and if so, how?

As far as the usual method to automate a SAS job, we do already do exactly what you have described with many other jobs we support. However, my task is to find out the feasibility of the original question.
Kurt_Bremser
Super User

I STRONGLY suggest you spare yourself all the hassle and use the mechanism you already have in place.

But maybe @ChrisHemedinger can shed some light if it is possible to feed prompt values into a project from a Windows environment.

ChrisHemedinger
Community Manager

You can technically use EG automation to script prompt values.  These are ProjectParameter objects in the automation model, and you get that list from the Project object.  

 

However, others are correct that if you want this to scale in a batch run, it might be easier to just set macro variables and/or environment values for your SAS programs to pick up.  But if your prompts are encoded in tasks, like the Query Builder, then the Project.Parameters property will get you the list.  You can then set the Value attribute on each ProjectParameter object.

 

 

 

 

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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