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.

 

 

 

 

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

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.

 

 

 

 

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1375 views
  • 2 likes
  • 3 in conversation