<?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: %Sysfunc in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sysfunc/m-p/190708#M35956</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%let medate=30MAY2014;&lt;/P&gt;&lt;P&gt;%let want=%sysfunc(intnx(month,"&amp;amp;medate"d,-12),yymmn4);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value of macrovariable &amp;amp;want is already text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; char="&amp;amp;want";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; num=&amp;amp;want;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Oct 2014 13:45:37 GMT</pubDate>
    <dc:creator>CTorres</dc:creator>
    <dc:date>2014-10-20T13:45:37Z</dc:date>
    <item>
      <title>%Sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sysfunc/m-p/190705#M35953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a macro variable that will contain the prior year and same month based on a current date. For example if the current date is 30MAY2014 I wiould like to get 1305.&amp;nbsp; However I keep getting an error with the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt; %let medate=30MAY2014;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; %Let Prior_Year=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;(cats(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;%substr&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;(putc(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;%Sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;(year("&amp;amp;medate"d)),4.),3,2)-1,putc(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;(month("&amp;amp;medate"d)),z2.)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;The error I am getting is the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: Required operator not found in expression: putc(5,z2.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would really appreciate any suggestions on how I can fix this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 00:21:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sysfunc/m-p/190705#M35953</guid>
      <dc:creator>SAS09</dc:creator>
      <dc:date>2014-10-20T00:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: %Sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sysfunc/m-p/190706#M35954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;39&amp;nbsp;&amp;nbsp; %let medate=30MAY2014;
40&amp;nbsp;&amp;nbsp; %put %sysfunc(intnx(month,"&amp;amp;medate"d,-12),yymmn4);
1305
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 01:06:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sysfunc/m-p/190706#M35954</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2014-10-20T01:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: %Sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sysfunc/m-p/190707#M35955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you - this is helpful!&amp;nbsp; However I need for this value to be in a character format.&amp;nbsp; Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 13:26:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sysfunc/m-p/190707#M35955</guid>
      <dc:creator>SAS09</dc:creator>
      <dc:date>2014-10-20T13:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: %Sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sysfunc/m-p/190708#M35956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%let medate=30MAY2014;&lt;/P&gt;&lt;P&gt;%let want=%sysfunc(intnx(month,"&amp;amp;medate"d,-12),yymmn4);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value of macrovariable &amp;amp;want is already text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; char="&amp;amp;want";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; num=&amp;amp;want;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 13:45:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sysfunc/m-p/190708#M35956</guid>
      <dc:creator>CTorres</dc:creator>
      <dc:date>2014-10-20T13:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: %Sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sysfunc/m-p/190709#M35957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well:&lt;/P&gt;&lt;P&gt;%let medate=30MAY2014;&lt;BR /&gt;data _null_;&lt;BR /&gt;&amp;nbsp; call symput('prior_year',put(intnx('month',"&amp;amp;medate"d,-12),yymmn4.));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;prior_year;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But my question would be, why not just use the calculation where you need it, no need to go creating new variables for it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 13:47:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sysfunc/m-p/190709#M35957</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-10-20T13:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: %Sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sysfunc/m-p/190710#M35958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assigning the value to a macro variable causes the intnx (or whatever method one uses) to be executed only once. Putting it into the later data step causes it to be executed with every iteration. The old-hand programmer in me cringes at that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 14:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sysfunc/m-p/190710#M35958</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-10-20T14:10:18Z</dc:date>
    </item>
  </channel>
</rss>

