<?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: macro Variable List in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-Variable-List/m-p/66119#M14358</link>
    <description>Thank you.&lt;BR /&gt;
I have a question.&lt;BR /&gt;
In  call symputx routine, &amp;amp;i is not allowed.This throws an error.&lt;BR /&gt;
How to pass the variable MTH&amp;amp;i to a macro variable &amp;amp;MTH&amp;amp;i.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%do i= 2 %to 6;&lt;BR /&gt;
  d&amp;amp;i.=put(intnx('month',input(d,date9.),%eval(1-&amp;amp;i.)),MONYY7.);&lt;BR /&gt;
  Mth&amp;amp;i.=SUBSTR(d&amp;amp;i.,1,3)||"-"||SUBSTR(d&amp;amp;i.,4);&lt;BR /&gt;
  call SYMPUTX('MTH&amp;amp;i.',Mth&amp;amp;i.); &lt;BR /&gt;
 %end;</description>
    <pubDate>Mon, 16 May 2011 18:45:57 GMT</pubDate>
    <dc:creator>SASPhile</dc:creator>
    <dc:date>2011-05-16T18:45:57Z</dc:date>
    <item>
      <title>macro Variable List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-Variable-List/m-p/66117#M14356</link>
      <description>If there is a variable date which takes value 1103 where 11 is year and 03 is month.&lt;BR /&gt;
how to create macro variables&lt;BR /&gt;
Mth1 which takes value Mar-2011&lt;BR /&gt;
Mth2 which takes value Feb-2011</description>
      <pubDate>Mon, 16 May 2011 15:06:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-Variable-List/m-p/66117#M14356</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2011-05-16T15:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: macro Variable List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-Variable-List/m-p/66118#M14357</link>
      <description>Hello SASPhile,&lt;BR /&gt;
&lt;BR /&gt;
This code does the trick:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  vd=1103;&lt;BR /&gt;
  m=MOD(vd,100);&lt;BR /&gt;
  y=2000+INT(vd/100);&lt;BR /&gt;
  d=PUT(MDY(m,01,y),MONYY7.);&lt;BR /&gt;
  Mth1=SUBSTR(d,1,3)||"-"||SUBSTR(d,4);&lt;BR /&gt;
  call SYMPUTX('Mth1',Mth1); &lt;BR /&gt;
run;&lt;BR /&gt;
%put Mth1=&amp;amp;Mth1;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Mon, 16 May 2011 17:33:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-Variable-List/m-p/66118#M14357</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2011-05-16T17:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: macro Variable List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-Variable-List/m-p/66119#M14358</link>
      <description>Thank you.&lt;BR /&gt;
I have a question.&lt;BR /&gt;
In  call symputx routine, &amp;amp;i is not allowed.This throws an error.&lt;BR /&gt;
How to pass the variable MTH&amp;amp;i to a macro variable &amp;amp;MTH&amp;amp;i.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%do i= 2 %to 6;&lt;BR /&gt;
  d&amp;amp;i.=put(intnx('month',input(d,date9.),%eval(1-&amp;amp;i.)),MONYY7.);&lt;BR /&gt;
  Mth&amp;amp;i.=SUBSTR(d&amp;amp;i.,1,3)||"-"||SUBSTR(d&amp;amp;i.,4);&lt;BR /&gt;
  call SYMPUTX('MTH&amp;amp;i.',Mth&amp;amp;i.); &lt;BR /&gt;
 %end;</description>
      <pubDate>Mon, 16 May 2011 18:45:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-Variable-List/m-p/66119#M14358</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2011-05-16T18:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: macro Variable List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-Variable-List/m-p/66120#M14359</link>
      <description>Change the single quotes in: &lt;BR /&gt;
call SYMPUTX('MTH&amp;amp;i.',Mth&amp;amp;i.); &lt;BR /&gt;
&lt;BR /&gt;
to double quotes:&lt;BR /&gt;
call SYMPUTX("MTH&amp;amp;i.",Mth&amp;amp;i.); &lt;BR /&gt;
&lt;BR /&gt;
and it should work for you...</description>
      <pubDate>Mon, 16 May 2011 19:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-Variable-List/m-p/66120#M14359</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2011-05-16T19:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: macro Variable List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-Variable-List/m-p/66121#M14360</link>
      <description>[pre]&lt;BR /&gt;
data a;&lt;BR /&gt;
input a $;&lt;BR /&gt;
a=cats(a,'01');&lt;BR /&gt;
want_a=input(a,yymmdd8.);&lt;BR /&gt;
format want_a monyy7.;&lt;BR /&gt;
&lt;BR /&gt;
put a= want_a=;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1102&lt;BR /&gt;
1104&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Wed, 18 May 2011 01:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-Variable-List/m-p/66121#M14360</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-05-18T01:32:57Z</dc:date>
    </item>
  </channel>
</rss>

