<?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: automating the execution? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/automating-the-execution/m-p/31255#M5998</link>
    <description>Question is if you want to execute a complete program on Friday or just a section of code in a program only on Friday.&lt;BR /&gt;
For the first you need a scheduler in your operating system.&lt;BR /&gt;
For the second I would suggest some macro code.&lt;BR /&gt;
&lt;BR /&gt;
data date_parms;&lt;BR /&gt;
  dow=put(today(),weekday1.);&lt;BR /&gt;
  call symputx('dow',dow);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Macro variable dow is the day of week. Friday is day 6. Within the macro program you would use the following code.&lt;BR /&gt;
&lt;BR /&gt;
%if &amp;amp;dow=6 %then&lt;BR /&gt;
  %do;&lt;BR /&gt;
    code segment;&lt;BR /&gt;
  %end;</description>
    <pubDate>Wed, 16 Jun 2010 18:59:24 GMT</pubDate>
    <dc:creator>barheat</dc:creator>
    <dc:date>2010-06-16T18:59:24Z</dc:date>
    <item>
      <title>automating the execution?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automating-the-execution/m-p/31251#M5994</link>
      <description>Q: If you want to execute a piece of SAS code only on the first Friday of every month, how will you achieve it? Write a sample code (in SAS) for the same.</description>
      <pubDate>Thu, 03 Jun 2010 17:26:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automating-the-execution/m-p/31251#M5994</guid>
      <dc:creator>Pavan_SAS</dc:creator>
      <dc:date>2010-06-03T17:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: automating the execution?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automating-the-execution/m-p/31252#M5995</link>
      <description>A: I suppose most schedulers has this functionality. But if you want to implement it using SAS, I suggest that you take a look at macro programming, together with the DAY and WEEKDAY functions.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Thu, 03 Jun 2010 17:31:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automating-the-execution/m-p/31252#M5995</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2010-06-03T17:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: automating the execution?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automating-the-execution/m-p/31253#M5996</link>
      <description>Hi:&lt;BR /&gt;
  Look at step #9 in this paper:&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi28/056-28.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi28/056-28.pdf&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
  This shows a particular report being submitted when the month is 6, 7 or 8 using a SAS Macro program. Your code would need to find and define a different date interval (probably using SAS functions)....but the overall approach would be similar.&lt;BR /&gt;
&lt;BR /&gt;
  I do suggest that you make sure you understand the code in steps 1-8 before jumping into step 9.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 03 Jun 2010 19:29:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automating-the-execution/m-p/31253#M5996</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-06-03T19:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: automating the execution?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automating-the-execution/m-p/31254#M5997</link>
      <description>Depending on your OS, there is likely an option for scheduling a "task" which would be to launch SAS and pass it your SYSIN which would contain the SAS program you want to execute.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic/post:&lt;BR /&gt;
&lt;BR /&gt;
sas batch sysin site:sas.com</description>
      <pubDate>Fri, 04 Jun 2010 12:00:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automating-the-execution/m-p/31254#M5997</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-06-04T12:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: automating the execution?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automating-the-execution/m-p/31255#M5998</link>
      <description>Question is if you want to execute a complete program on Friday or just a section of code in a program only on Friday.&lt;BR /&gt;
For the first you need a scheduler in your operating system.&lt;BR /&gt;
For the second I would suggest some macro code.&lt;BR /&gt;
&lt;BR /&gt;
data date_parms;&lt;BR /&gt;
  dow=put(today(),weekday1.);&lt;BR /&gt;
  call symputx('dow',dow);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Macro variable dow is the day of week. Friday is day 6. Within the macro program you would use the following code.&lt;BR /&gt;
&lt;BR /&gt;
%if &amp;amp;dow=6 %then&lt;BR /&gt;
  %do;&lt;BR /&gt;
    code segment;&lt;BR /&gt;
  %end;</description>
      <pubDate>Wed, 16 Jun 2010 18:59:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automating-the-execution/m-p/31255#M5998</guid>
      <dc:creator>barheat</dc:creator>
      <dc:date>2010-06-16T18:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: automating the execution?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automating-the-execution/m-p/31256#M5999</link>
      <description>Barheat - thanks for the day of week tip - I have been trying to use something like this but must have missed something along the way.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Pavan@SAS-  We are running 9.2 on a remote server with XP, and this is how I get to the scheduler:&lt;BR /&gt;
&lt;BR /&gt;
Start -&amp;gt; All Programs -&amp;gt; Accessories -&amp;gt; System Tools -&amp;gt; Scheduled Tasks&lt;BR /&gt;
&lt;BR /&gt;
And in the run window I have the following all in one string:&lt;BR /&gt;
&lt;BR /&gt;
D:\SAS9.2\SASFoundation\9.2\sas.exe &lt;BR /&gt;
-AUTOEXEC  D:\SASData\myarea\AUTOEXEC.SAS &lt;BR /&gt;
-SYSIN D:\SASData\myarea\run_this_file.sas&lt;BR /&gt;
&lt;BR /&gt;
Good luck!&lt;BR /&gt;
&lt;BR /&gt;
Wendy T

Message was edited by: WendyT</description>
      <pubDate>Thu, 17 Jun 2010 17:49:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automating-the-execution/m-p/31256#M5999</guid>
      <dc:creator>WendyT</dc:creator>
      <dc:date>2010-06-17T17:49:07Z</dc:date>
    </item>
  </channel>
</rss>

