04-18-2017 02:30 AM
Need the assistance regarding the Crontab Job Sheduling, I have the .Sas Program file (macro which create the Library for reporting)
and these need to be sheduled on dialy basis.Since, we do not have the LSF Job sheduler and this job need be be sheduled in the Crontab.please help me step by step to shedule this .sas job.
04-18-2017 03:31 AM
Step 1: Determine at which time the job should run
Step 2: switch to the user that is supposed to run the scheduled job (in any commandline window)
Step 3: enter the command crontab -e
your current crontab setting will be read and opened with vi (the classical UNIX fullscreen editor)
Step 3: if the crontab is not empty, navigate to the last line of the file
Step 4: enter "A" to start insert mode at the end of the current line; if the line is not empty, add a new line with [return]
Step 5: enter a line in the following format:
minutes hours day month weekday command
the columns are separated by blank space, blank spaces in the command do not matter, as it is the last column anyway
in every one of the first 5 columns, an asterisk can be entered to enable running in every occurence (every minute, every day, ...)
your line would probably look like
35 4 * * * /usr/local/SAS/SASFoundation/9.4/sas program.sas
meaning your program runs at 04:35 every day.
Step 5: press Escape, and then enter a colon immediately followed by a (non-capital!) x
this exits insert mode, saves the temporary file, and exits vi; crontab will then save your edited cron table to /var/spool/cron/crontabs/username, and your scheduled command will be active.
An explanation and short crontab tutorial can be found here: http://www.adminschoice.com/crontab-quick-reference
04-18-2017 07:39 AM