BookmarkSubscribeRSS Feed

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

Started ‎02-13-2018 by
Modified ‎02-13-2018 by
Views 9,723

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:

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started

Article Tags