Below how this looks like in the environment I'm currently working in.
sso/biconfig/940/Lev1/SASApp/BatchServer/sasbatch.sh -log .../logs/program_ -batch -noterminal -logparm "rollover=session" -sysin .../program.sas
Depending on the config in your environment you will eventually have to add some specific directives to create a log name with a date portion. How to documented here.
Adding the destination and name for printed output explicitly is also not a bad idea. Would be -print ..../program.lst ....and you could also use some time directives there to not just overwrite your listing output. ....or if you don't want any listing output then point to /dev/null
This doc should help you. It is best practice to specify log locations using the -LOG option when invoking your batch SAS job
That should create a file named programname.log (and programname.lst for the "listing" output as they now want to call it) in the current directory.
If you want the files written somewhere else using the -log and -print command line options.
Below how this looks like in the environment I'm currently working in.
sso/biconfig/940/Lev1/SASApp/BatchServer/sasbatch.sh -log .../logs/program_ -batch -noterminal -logparm "rollover=session" -sysin .../program.sas
Depending on the config in your environment you will eventually have to add some specific directives to create a log name with a date portion. How to documented here.
Adding the destination and name for printed output explicitly is also not a bad idea. Would be -print ..../program.lst ....and you could also use some time directives there to not just overwrite your listing output. ....or if you don't want any listing output then point to /dev/null
Make it a habit to use only fully qualified path names in OS commands, especially when writing shell scripts.
This makes the commandline resilient against any changes in current working directory, and you will often need to redirect stuff like log files because the script won't have write permission on the CWD, and you don't want to clutter up your program directory with logs.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.