<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable/m-p/184622#M35028</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What exactly is the result supposed to be?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may be wanting to use %sysfunc as %eval only works for integer arithmetic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Feb 2014 20:47:49 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2014-02-24T20:47:49Z</dc:date>
    <item>
      <title>Macro Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable/m-p/184621#M35027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;I'm trying to assign a text string to a macro variable using the code below. I've tried several different ways and none seem to be working. Any help for this macro newbie would be greatly appreciated. Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; StartYr = 2008;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; NxtYr=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;%eval&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;(&amp;amp;StartYr + 1); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; Y1Y2 = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;%eval&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;(cat(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;%eval&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;(substr("&amp;amp;StartYr",3,2)),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;%eval&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;(substr("&amp;amp;NxtYr",3,2))));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1454&amp;nbsp; %Let Y1Y2 = %eval(cat(%eval(substr("&amp;amp;StartYr",3,2)),%eval(substr("&amp;amp;NxtYr",3,2))));&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable STARTYR resolves to 2008&lt;/P&gt;&lt;P&gt;ERROR: Required operator not found in expression: substr("2008",3,2)&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable NXTYR resolves to 2009&lt;/P&gt;&lt;P&gt;ERROR: Required operator not found in expression: substr("2009",3,2)&lt;/P&gt;&lt;P&gt;ERROR: Required operator not found in expression: cat(,)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 19:34:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable/m-p/184621#M35027</guid>
      <dc:creator>BTAinRVA</dc:creator>
      <dc:date>2014-02-24T19:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable/m-p/184622#M35028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What exactly is the result supposed to be?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may be wanting to use %sysfunc as %eval only works for integer arithmetic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 20:47:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable/m-p/184622#M35028</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-02-24T20:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable/m-p/184623#M35029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want Y1Y2 to equal the combined last two characters of StartYr and NxtYr. So if they are 2008 and 2009 I want Y1Y2 to be 0809.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 20:50:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable/m-p/184623#M35029</guid>
      <dc:creator>BTAinRVA</dc:creator>
      <dc:date>2014-02-24T20:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable/m-p/184624#M35030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;%let Y1Y2 = %sysfunc(substr(&amp;amp;StartYr,3,2))%sysfunc(substr(&amp;amp;NxtYr,3,2));&lt;/P&gt;&lt;P&gt;/* note NO space between )%sysfunc */&lt;/P&gt;&lt;P&gt;When I tried using Cat it seems like it wants to resolve the 08 to a numeric 8 loosing the leading 0 and the same with 09*/&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 22:11:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable/m-p/184624#M35030</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-02-24T22:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable/m-p/184625#M35031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try % substr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 22:11:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable/m-p/184625#M35031</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-02-24T22:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable/m-p/184626#M35032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;forehead pop&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 22:42:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable/m-p/184626#M35032</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-02-24T22:42:58Z</dc:date>
    </item>
  </channel>
</rss>

