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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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