<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Automate SAS Script in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Automate-SAS-Script/m-p/342124#M2145</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Not a complete answer., but it might help.

You may need to have your programs check the 'trigger' file. I like to use
a Perl script to do the checking and execute the SAS jobs.

/* T004680 SETTING UP CHRON JOBS ON UNIX AND WINDOWS

THIS IS A VERY OLD TIP CIRCA WIN 2000
=====================================

start&amp;gt;Control Panel\System and Security\Administrative Tools\scheduled tasks

put the following in run dialog box
C:\Program Files\SAS\SAS 9.1\sas.exe" -nosplash -sysin c:\sas\pgm.sas -log nul: -print nul:
put the following in start in box
c:\sas

You don't have to have a null log or null list.
I send an email with the log and list when the program fails

IN UNIX
=======

create a file called cronjob.txt with just the line below

0 2 * * 1-5 /groundtruth/programs/program.csh

Details
mm hh dd mon day
0   2  *  *  1-5 /groundtruth/programs/program.csh

run at 2am every monday-friday

here is what program.csh looks like(executes sas myprogram
#!/usr/bin/csh
cd /groundtruth/sas/programs
/groundtruth/local/bin/sas mysasprogram

You can execute crontab if your name appears in the file /usr/lib/cron/cron.allow

crontab -e      Edit your crontab file, or create one if it doesn?t already exist.
crontab -l      Display your crontab file.
crontab -r      Remove your crontab file.
crontab -v      Display the last time you edited your crontab file.



&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 17 Mar 2017 19:19:00 GMT</pubDate>
    <dc:creator>rogerjdeangelis</dc:creator>
    <dc:date>2017-03-17T19:19:00Z</dc:date>
    <item>
      <title>Automate SAS Script</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Automate-SAS-Script/m-p/342117#M2144</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm currently trying to automate two SAS programs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I want a SAS script to run at 3 seperate times 5 days a week. M-F at 12 pm, 4 pm and 7 pm EST. The only method I've gotten to work is that Windows will run SAS studios and open the SAS script for me, but it won't press 'Run'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. I want a SAS script to be triggered by a change in the source table that I'm using. A little context,&amp;nbsp;the source table has entries put into it anytime an external script 'fails' and puts all the information about the job into a row based table. I want my SAS script to pull these entries as soon as the table has entries put into it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any tips&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 19:04:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Automate-SAS-Script/m-p/342117#M2144</guid>
      <dc:creator>cmacknair</dc:creator>
      <dc:date>2017-03-17T19:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Automate SAS Script</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Automate-SAS-Script/m-p/342124#M2145</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Not a complete answer., but it might help.

You may need to have your programs check the 'trigger' file. I like to use
a Perl script to do the checking and execute the SAS jobs.

/* T004680 SETTING UP CHRON JOBS ON UNIX AND WINDOWS

THIS IS A VERY OLD TIP CIRCA WIN 2000
=====================================

start&amp;gt;Control Panel\System and Security\Administrative Tools\scheduled tasks

put the following in run dialog box
C:\Program Files\SAS\SAS 9.1\sas.exe" -nosplash -sysin c:\sas\pgm.sas -log nul: -print nul:
put the following in start in box
c:\sas

You don't have to have a null log or null list.
I send an email with the log and list when the program fails

IN UNIX
=======

create a file called cronjob.txt with just the line below

0 2 * * 1-5 /groundtruth/programs/program.csh

Details
mm hh dd mon day
0   2  *  *  1-5 /groundtruth/programs/program.csh

run at 2am every monday-friday

here is what program.csh looks like(executes sas myprogram
#!/usr/bin/csh
cd /groundtruth/sas/programs
/groundtruth/local/bin/sas mysasprogram

You can execute crontab if your name appears in the file /usr/lib/cron/cron.allow

crontab -e      Edit your crontab file, or create one if it doesn?t already exist.
crontab -l      Display your crontab file.
crontab -r      Remove your crontab file.
crontab -v      Display the last time you edited your crontab file.



&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Mar 2017 19:19:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Automate-SAS-Script/m-p/342124#M2145</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-03-17T19:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Automate SAS Script</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Automate-SAS-Script/m-p/342212#M2151</link>
      <description>&lt;P&gt;As far as I'm aware you can't currently schedule programs via SAS Studio. How are you using SAS Studio? With a remote SAS server, SAS UE or some other method? If you are using a remote server, that will usually have scheduling tools available to you.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2017 02:32:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Automate-SAS-Script/m-p/342212#M2151</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-03-18T02:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Automate SAS Script</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Automate-SAS-Script/m-p/342963#M2169</link>
      <description>&lt;P&gt;"&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token datetime number"&gt;THIS IS A VERY OLD TIP CIRCA WIN 2000
=====================================

start&amp;gt;Control Panel\System and Security\Administrative Tools\scheduled tasks

put the following in run dialog box
C:\Program Files\SAS\SAS 9.1\sas.exe" -nosplash -sysin c:\sas\pgm.sas -log nul: -print nul:
put the following in start in box
c:\sas

You don't&lt;/SPAN&gt; have to have a null &lt;SPAN class="token function"&gt;log&lt;/SPAN&gt; or null list&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;
I send an email with the &lt;SPAN class="token function"&gt;log&lt;/SPAN&gt; and list when the program fails&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this bit I have used before but whenever I use it this way it literally just opens SAS for me and then opens 'pgm.sas' to work on but does nothing else. Doesn't run the job as I would obviously want it to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for the UNIX solution I unfortunately don't have access to run shell scripts in the system I'm working on.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 15:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Automate-SAS-Script/m-p/342963#M2169</guid>
      <dc:creator>cmacknair</dc:creator>
      <dc:date>2017-03-21T15:15:32Z</dc:date>
    </item>
  </channel>
</rss>

