BookmarkSubscribeRSS Feed
GeorgeSAS
Lapis Lazuli | Level 10

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!

5 REPLIES 5
JerryV
SAS Employee

Check out sasbatch.sh in your <ConfigDir>\Lev1\SASApp\BatchServer directory. 

You can use that and pass in -sysin <mySASProgram> -log <writeMyLogHere>

 

Astounding
PROC Star
On the unix server, modify your .profile so it "knows" where to look to execute the "sas" command. Then from the unix folder that holds the program, enter the command:

sas programname

You will likely need help setting up the path command within your profile.
SASKiwi
PROC Star

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.

andreas_lds
Jade | Level 19

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.

ErikLund_Jensen
Rhodochrosite | Level 12

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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 1018 views
  • 0 likes
  • 6 in conversation