BookmarkSubscribeRSS Feed

Simple steps to schedule a SAS job in UNIX (PUTTY)

Started ‎02-13-2018 by
Modified ‎02-13-2018 by
Views 8,645

This was a contributed tip by @ragivenk189, nominated for inclusion in our library.  These steps use the built-in at command in Unix.

 

  1. Go to the desired folder under Unix shell.   
  1. cd to the directory on the Unix where your SAS program resides. 
  1. At the command prompt: type: at 2am tomorrow (Hit enter)It will show at> prompt. 
  1. at> nohup sas test.sas (hit enter)

The nohup utility can be used when it is known that command will take a long time to run and the user wants to logout of the terminal; By default, when a shell exits, the system sends its children SIGHUP signals, which by default cause them to be killed. 

 

However, with nohup, background jobs will ignore SIGHUP and continue running, if their invocation is preceded by the nohup command or if the process programmatically has chosen to ignore SIGHUP.

 

  1. at> press <Ctrl>+<d> (to save this)

 

  1. You can check if it has been scheduled, by typing: at -l.  It will list something like this: 
job 107225020.a at Friday Oct 26th 2am

If you want to remove the above job from the queue, type:  at -r 107225020.a

This command deletes the scheduled job.

 

If you like to submit a job at a specified date you can type:

 

  at 0815am nov 02

 

Here the job will run on Nov 2nd at 8.15am.

 


For another approach that uses shell scripts, see Running SAS programs under Unix/Linux by @LeonidBatkhan.

Comments

Use 

at -c 107225020.a

to see what command(s) the job will run

Version history
Last update:
‎02-13-2018 10:30 AM
Updated by:

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!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags