Hello,
I have tested my SAS function on the production server (unix server) using SAS EG.
But, from now, I would like to know how to execute the SAS function and passing parameter such as orderdate, ordertime, file destination and filename on a Unix server but now from a terminal windows.
Please provide an example
You can set environment variables in the script that calls your SAS program, and retrieve the values with %SYSGET.
@alepage wrote:
Hello,
I have tested my SAS function on the production server (unix server) using SAS EG.
But, from now, I would like to know how to execute the SAS function and passing parameter such as orderdate, ordertime, file destination and filename on a Unix server but now from a terminal windows.
Please provide an example
It is not at all clear what you are trying to do. "FUNCTION" is probably not the right word here. You can define a function in SAS using PROC FCMP, but that would have little to with working from command line.
You also posted this under the Enterprise Guide forum. Are you using Enterprise Guide to submit your SAS code? Are you trying to call some EG PROJECT from the Unix command line?
Or do you have an actual .sas PROGRAM that you want to run using regular old SAS directly from the command line?
Which one you have probably makes a big difference for how you can pass in user specified values.
If you just have a SAS program you can look at the -set command line option. Or the older -sysparm command line option.
If you want to run a whole Enterprise Guide project flow then something else is probably needed.
You can set environment variables in the script that calls your SAS program, and retrieve the values with %SYSGET.
Home > Programming > Programming > Unix: passing parameter to a SAS program in command line
https://communities.sas.com/t5/SAS-Programming/Unix-passing-parameter-to-a-SAS-program-in-command-li...
Above topic was solved ! Have a look.
Koen
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.