Hello everyone,
I program on unix SAS from SAS EG.
I working in SAS EG which connect to the unix server. also I use putty which connect to the unix server to manage my SAS files( SAS programs, SAS logs and SAS datasets etc) in that server.
My question is how I can use batch mode to submit SAS program from putty(or any other terminal) instead of from SAS EG?
Thank you!
Check out sasbatch.sh in your <ConfigDir>\Lev1\SASApp\BatchServer directory.
You can use that and pass in -sysin <mySASProgram> -log <writeMyLogHere>
If you have the SAS client tool SAS Management Console available you can run batch jobs via the Schedule Manager - no command line stuff is required.
Have you talked to the server-administrator? If not do it before you try anything else. The admin might not be that happy if you schedule jobs outside of business-hours interfering maintenance-jobs.
Hi @GeorgeSAS
A call direct to sas.exe would give you a "raw" SAS without the -config or autoexec settings defined in the EG workspace server, so you will be on your own and have to include these informations in your call. Using sasbatch.sh might not be a good idea either, as it might be modified for daily batch processing.
So talk to your administrator. It seems that she has a relaxed approach to server operation, since you have terminal access to the server and not only FTP, and she might be willing to tailor a special command for you.
If I was your administrator and you came with convincing reasons, I would make a userbatch.sh file using a setup similar to that found in the SAS EG environment, and set it to write -log and -lst files to the same directory as the -sysin file. Then you could just call the command with your program as argument. I would use nohup, so the job would continue when you signed out from your terminal session, and I might add a -termstmt macro to send a SMS to a number supplied as second argument to the command and passed as -sysparm, when the job is complete.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.