<?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: conditionally run proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/conditionally-run-proc-sql/m-p/347872#M273346</link>
    <description>&lt;P&gt;yeah, that worked out great but while i was waiting i also wroote a macro to do that same thing...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let mnth=%sysfunc(month(%sysfunc(today())));&lt;BR /&gt;%macro monthtest;&lt;BR /&gt;%if &amp;amp;mnth^=4 %then %do;&lt;BR /&gt;proc sql;&lt;BR /&gt;select * from TABLE where ID&amp;lt;=100;&lt;BR /&gt;%end;&lt;BR /&gt;%else %if &amp;amp;mnth=4 %then %do;&lt;BR /&gt;proc sql;&lt;BR /&gt;select * from TABLE where 100&amp;lt;=ID&amp;lt;=200;&lt;BR /&gt;;&lt;BR /&gt;%end;&lt;BR /&gt;%mend monthtest;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;%monthtest&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...and to the other questions, what i needed to do was based on whether it was jan or not, if so i needed to mark some delete=y under 2 certain conditions of other columns in the data.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Apr 2017 18:50:11 GMT</pubDate>
    <dc:creator>me55</dc:creator>
    <dc:date>2017-04-06T18:50:11Z</dc:date>
    <item>
      <title>conditionally run proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/conditionally-run-proc-sql/m-p/347813#M273343</link>
      <description>&lt;P&gt;i am somewhat new to sas, so what i want to do is execute some sql only on a certain month.&amp;nbsp; so i want...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;update table&lt;/P&gt;&lt;P&gt;set field='Y';&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to run in a larger program only when the month is january.&amp;nbsp; i am sure it is a fairly easy solution, just having trouble finding the right one.&amp;nbsp; i am using sas eg 7.1 tyi.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 16:14:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/conditionally-run-proc-sql/m-p/347813#M273343</guid>
      <dc:creator>me55</dc:creator>
      <dc:date>2017-04-06T16:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: conditionally run proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/conditionally-run-proc-sql/m-p/347844#M273344</link>
      <description>&lt;P&gt;First, you will need working PROC SQL code.&amp;nbsp; I leave that to you as a separate issue.&amp;nbsp; For a short program like you have illustrated, here is an easy way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;if month(today())=1 then call execute(&lt;/P&gt;
&lt;P&gt;"proc sql;&lt;/P&gt;
&lt;P&gt;update table&lt;/P&gt;
&lt;P&gt;set field='Y';&lt;/P&gt;
&lt;P&gt;;"&lt;/P&gt;
&lt;P&gt;);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 17:16:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/conditionally-run-proc-sql/m-p/347844#M273344</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-06T17:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: conditionally run proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/conditionally-run-proc-sql/m-p/347854#M273345</link>
      <description>&lt;P&gt;I am not quite sure if you want to conditionally execute Proc Sql or if you only want to process some records within a data set based on the value of a variable in the data set.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 17:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/conditionally-run-proc-sql/m-p/347854#M273345</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-06T17:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: conditionally run proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/conditionally-run-proc-sql/m-p/347872#M273346</link>
      <description>&lt;P&gt;yeah, that worked out great but while i was waiting i also wroote a macro to do that same thing...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let mnth=%sysfunc(month(%sysfunc(today())));&lt;BR /&gt;%macro monthtest;&lt;BR /&gt;%if &amp;amp;mnth^=4 %then %do;&lt;BR /&gt;proc sql;&lt;BR /&gt;select * from TABLE where ID&amp;lt;=100;&lt;BR /&gt;%end;&lt;BR /&gt;%else %if &amp;amp;mnth=4 %then %do;&lt;BR /&gt;proc sql;&lt;BR /&gt;select * from TABLE where 100&amp;lt;=ID&amp;lt;=200;&lt;BR /&gt;;&lt;BR /&gt;%end;&lt;BR /&gt;%mend monthtest;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;%monthtest&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...and to the other questions, what i needed to do was based on whether it was jan or not, if so i needed to mark some delete=y under 2 certain conditions of other columns in the data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 18:50:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/conditionally-run-proc-sql/m-p/347872#M273346</guid>
      <dc:creator>me55</dc:creator>
      <dc:date>2017-04-06T18:50:11Z</dc:date>
    </item>
  </channel>
</rss>

