<?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: Multiple Code Execution in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Code-Execution/m-p/403754#M98120</link>
    <description>&lt;P&gt;The SAS Scheduling guide is a good place to start:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=scheduleug&amp;amp;docsetTarget=n1c1fie1vigujin12wrepb4kdq87.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=scheduleug&amp;amp;docsetTarget=n1c1fie1vigujin12wrepb4kdq87.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would also check with your IT folks regarding any tools used currently.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Oct 2017 02:03:55 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2017-10-13T02:03:55Z</dc:date>
    <item>
      <title>Multiple Code Execution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Code-Execution/m-p/403737#M98111</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a code, that executes multiple codes based on the code frequency.&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;if the code "A"&amp;nbsp;frequency is daily, then it will be executed Daily&lt;/P&gt;&lt;P&gt;If code "B" frequency is weekly then it will be executed weekly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are 12 codes, out of which&lt;/P&gt;&lt;P&gt;Daily&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;Weekly -&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;Monthly - 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current situation&amp;nbsp; is, if there is one code fails, then SAS stops executing the rest of the code.&lt;/P&gt;&lt;P&gt;I want to change it, so that even if one rule fails, SAS should execute the rest of the code and produce output , and a notification should be sent informing which code failed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;libname test&amp;nbsp; "/data/DEV/SYS";&lt;/P&gt;&lt;P&gt;%let RUNDATE = &amp;amp;SYSDATE9;&lt;BR /&gt;%put &amp;amp;rundate.;&lt;/P&gt;&lt;P&gt;%put %sysfunc(weekday("&amp;amp;RUNDATE."d));&lt;BR /&gt;%put %sysfunc(day("&amp;amp;RUNDATE."d));&lt;/P&gt;&lt;P&gt;PROC PRINTTO LOG=LOG; RUN;&lt;/P&gt;&lt;P&gt;%macro run_code(frequency, file_name, output_file);&lt;BR /&gt;&amp;nbsp;%let file_path = /data/DEV/SYS/CODE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;%if ("&amp;amp;frequency." = "Daily")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;or ("&amp;amp;frequency." = "Weekly" and %sysfunc(weekday("&amp;amp;RUNDATE."d))=1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;or ("&amp;amp;frequency" = "Monthly" and %sysfunc(day("&amp;amp;RUNDATE."d))=6) %then %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;%include "&amp;amp;file_path./&amp;amp;file_name.";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;%put "&amp;amp;frequency.";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;%put "&amp;amp;file_path./&amp;amp;file_name.";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;data results;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;set results test.&amp;amp;output_file. (keep= Name Description Country State);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;run;&lt;BR /&gt;&amp;nbsp;%end;&lt;BR /&gt;%mend run_code;&lt;/P&gt;&lt;P&gt;data results;&lt;BR /&gt;&amp;nbsp;set _NULL_;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _NULL_;&lt;BR /&gt;&amp;nbsp;set test.rule_input;&lt;BR /&gt;&amp;nbsp;call execute ('%run_code('||TRIM(Frequency)||','||TRIM(SASFILE)||','||TRIM(output_file)||')');&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;picture date_b_fmt(default=45)&lt;BR /&gt;low-high='%Y-%0m-%0d %0H:%0M:%0S'(datatype=datetime);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data test.ALLCust_&amp;amp;RUNDATE.;&lt;BR /&gt;set results;&lt;BR /&gt;format run_date date_b_fmt.;&lt;BR /&gt;format rundate1 date9.;&lt;BR /&gt;Run_date=datetime();&lt;BR /&gt;Rundate1=today();&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*END OF CODE*/&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 00:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Code-Execution/m-p/403737#M98111</guid>
      <dc:creator>SAS_INFO</dc:creator>
      <dc:date>2017-10-13T00:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Code Execution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Code-Execution/m-p/403744#M98116</link>
      <description>&lt;P&gt;I'm guessing that your code is running with the SAS option SYNTAXCHECK. Trying NO&lt;SPAN&gt;SYNTAXCHECK may give you the behaviour you want.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://documentation.sas.com/?docsetId=lesysoptsref&amp;amp;docsetTarget=n014qbvh3po8w5n1qlqbzr22vtg0.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=lesysoptsref&amp;amp;docsetTarget=n014qbvh3po8w5n1qlqbzr22vtg0.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Rather than controlling your SAS programs using SAS, using a scheduling tool would allow you to have better control as well as automatically emailing if there is a problem.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 01:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Code-Execution/m-p/403744#M98116</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-10-13T01:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Code Execution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Code-Execution/m-p/403748#M98118</link>
      <description>&lt;P&gt;hi SASKIWI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can u guide be about the scheduling tools,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aruna B&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 01:42:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Code-Execution/m-p/403748#M98118</guid>
      <dc:creator>SAS_INFO</dc:creator>
      <dc:date>2017-10-13T01:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Code Execution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Code-Execution/m-p/403754#M98120</link>
      <description>&lt;P&gt;The SAS Scheduling guide is a good place to start:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=scheduleug&amp;amp;docsetTarget=n1c1fie1vigujin12wrepb4kdq87.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=scheduleug&amp;amp;docsetTarget=n1c1fie1vigujin12wrepb4kdq87.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would also check with your IT folks regarding any tools used currently.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 02:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Code-Execution/m-p/403754#M98120</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-10-13T02:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Code Execution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Code-Execution/m-p/403781#M98135</link>
      <description>&lt;P&gt;&amp;nbsp;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The viable option is to schedule the code individually, so that one code failure will not affect the others.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moving on to the next request, Once all the codes are executed, all their output datasets needs to get appended to one dataset.&lt;/P&gt;&lt;P&gt;Now, the same scenario, if any one of the output is not available the entire appending will not work, I need&amp;nbsp; a solution so that even any one or two output dataset&amp;nbsp;&amp;nbsp;is not available, the other output datasets should get appended.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ar&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 03:32:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Code-Execution/m-p/403781#M98135</guid>
      <dc:creator>SAS_INFO</dc:creator>
      <dc:date>2017-10-13T03:32:59Z</dc:date>
    </item>
  </channel>
</rss>

