<?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: how to convert date in a macro into character in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-in-a-macro-into-character/m-p/402736#M97826</link>
    <description>&lt;P&gt;The put() function is one of those that are not available in %sysfunc and %qsysfunc.&lt;/P&gt;
&lt;P&gt;See here: &lt;A href="http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.2&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=p1o13d7wb2zfcnn19s5ssl2zdxvi.htm&amp;amp;locale=de#n0x97dl6jtc5ujn1iowwm5bp8p4m" target="_blank"&gt;http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.2&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=p1o13d7wb2zfcnn19s5ssl2zdxvi.htm&amp;amp;locale=de#n0x97dl6jtc5ujn1iowwm5bp8p4m&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Use the putn() function instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let date=%sysfunc(intnx(month, '31Oct2017'd, 2));

%let label=%sysfunc(putn(&amp;amp;date,date9.));
%put &amp;amp;label;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or do it in one step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let label=%sysfunc(intnx(month, '31Oct2017'd, 2),date9.);

%put &amp;amp;label;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 10 Oct 2017 13:22:03 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-10-10T13:22:03Z</dc:date>
    <item>
      <title>how to convert date in a macro into character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-in-a-macro-into-character/m-p/402727#M97823</link>
      <description>&lt;P&gt;I am trying to convert the date variable in a macro into a character variable called "label".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let date=%qsysfunc(intnx(month, '31Oct2017'd, 2));&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But the following gives errors. Any idea how to achieve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let label=%sysfunc(put(&amp;amp;date, date9.));&lt;/P&gt;&lt;P&gt;ERROR: The PUT function referenced in the %SYSFUNC or %QSYSFUNC macro function is not found.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 13:10:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-in-a-macro-into-character/m-p/402727#M97823</guid>
      <dc:creator>dyxdyx</dc:creator>
      <dc:date>2017-10-10T13:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date in a macro into character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-in-a-macro-into-character/m-p/402735#M97825</link>
      <description>&lt;P&gt;%SYSFUNC cannot be used with PUT.&amp;nbsp; You have to switch to PUTN (in this case) or PUTC (in some cases) instead.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 13:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-in-a-macro-into-character/m-p/402735#M97825</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-10-10T13:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date in a macro into character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-in-a-macro-into-character/m-p/402736#M97826</link>
      <description>&lt;P&gt;The put() function is one of those that are not available in %sysfunc and %qsysfunc.&lt;/P&gt;
&lt;P&gt;See here: &lt;A href="http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.2&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=p1o13d7wb2zfcnn19s5ssl2zdxvi.htm&amp;amp;locale=de#n0x97dl6jtc5ujn1iowwm5bp8p4m" target="_blank"&gt;http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.2&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=p1o13d7wb2zfcnn19s5ssl2zdxvi.htm&amp;amp;locale=de#n0x97dl6jtc5ujn1iowwm5bp8p4m&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Use the putn() function instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let date=%sysfunc(intnx(month, '31Oct2017'd, 2));

%let label=%sysfunc(putn(&amp;amp;date,date9.));
%put &amp;amp;label;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or do it in one step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let label=%sysfunc(intnx(month, '31Oct2017'd, 2),date9.);

%put &amp;amp;label;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Oct 2017 13:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-in-a-macro-into-character/m-p/402736#M97826</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-10T13:22:03Z</dc:date>
    </item>
  </channel>
</rss>

