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!
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.
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.
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.
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.