<?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: Help with macro in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-in-SAS/m-p/311018#M67111</link>
    <description>&lt;P&gt;The macro language is something we can get to. &amp;nbsp;But first, should you change the objective? &amp;nbsp;You can remove the DAY from the data set name, but why switch the order? &amp;nbsp;If you keep the names as &amp;amp;YEAR&amp;amp;MONTH instead of &amp;amp;MONTH&amp;amp;YEAR, all the data set names would remain in order. &amp;nbsp;Isn't that a better result?&lt;/P&gt;</description>
    <pubDate>Fri, 11 Nov 2016 16:37:06 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-11-11T16:37:06Z</dc:date>
    <item>
      <title>Help with macro in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-in-SAS/m-p/310961#M67103</link>
      <description>&lt;DIV class="tw-swapa"&gt;&amp;nbsp;the idea is this, I need the macro to change my data and set as the days months and year.&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;i have 44 dataset are called like this:&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;Acr_maestro_mes_ant_20150131&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;Acr_maestro_mes_ant_20150331&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;Acr_maestro_mes_ant_20150430&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;.....................................................&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;Acr_maestro_mes_ant_20160931&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;Acr_maestro_mes_ant_20161030&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;I need the macro to change the date i would not have to create such a long consultation.&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;I did the following:&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;%MACRO COSECHA;&lt;BR /&gt;%LET DIA = ;&lt;BR /&gt;%DO año = 15 %TO 16;&lt;BR /&gt;%DO MES = 01 %TO 12;&lt;BR /&gt;&lt;BR /&gt;%IF ("&amp;amp;MES" = 01 OR "&amp;amp;MES" = 03 or "&amp;amp;MES" = 05 OR "&amp;amp;MES" =07 OR "&amp;amp;MES" = 08 OR "&amp;amp;MES" = 09 OR "&amp;amp;MES" = 12) %THEN "&amp;amp;DIA" = 31;&lt;BR /&gt;%IF ("&amp;amp;MES" = 04 OR "&amp;amp;MES" = 06 or "&amp;amp;MES" = 10 OR "&amp;amp;MES" =11) %THEN "&amp;amp;DIA" = 30;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;data&amp;nbsp; prueba.Acr_maestro_"$MES$AÑO";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;set prueba.Acr_maestro_mes_ant_"&amp;amp;AÑO&amp;amp;MES&amp;amp;DIA";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;where LLAMADA= 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;keep ID LLAMADA SOLICITUD FECHA;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;%END;&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;I`m sure that something is missing in the query, this is the first time that i work with macros in SAS, if you can help me i would appreciate.&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;Sorry for my bad english.&lt;/DIV&gt;&lt;DIV class="tw-swapa"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 11 Nov 2016 13:28:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-in-SAS/m-p/310961#M67103</guid>
      <dc:creator>Brayanduran</dc:creator>
      <dc:date>2016-11-11T13:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with macro in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-in-SAS/m-p/310975#M67104</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is and ideas area for SAS, not a place to ask questions on specific problems. &amp;nbsp;Post your question within the relevant subgroup.&lt;/P&gt;
&lt;P&gt;As a tip, avoid putting data in dataset names (dates in this case), it will just make your coding effort far more complicated and harder to maintain, plus worse resource wise. &amp;nbsp;Secondly look at the indsname= option on a set statement, you can manipulate that (which is the dataset name from the input dataset).&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2016 13:51:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-in-SAS/m-p/310975#M67104</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-11T13:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with macro in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-in-SAS/m-p/311018#M67111</link>
      <description>&lt;P&gt;The macro language is something we can get to. &amp;nbsp;But first, should you change the objective? &amp;nbsp;You can remove the DAY from the data set name, but why switch the order? &amp;nbsp;If you keep the names as &amp;amp;YEAR&amp;amp;MONTH instead of &amp;amp;MONTH&amp;amp;YEAR, all the data set names would remain in order. &amp;nbsp;Isn't that a better result?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2016 16:37:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-in-SAS/m-p/311018#M67111</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-11-11T16:37:06Z</dc:date>
    </item>
  </channel>
</rss>

