<?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 to convert SAS date does not work in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sysfunc-to-convert-SAS-date-does-not-work/m-p/443775#M111046</link>
    <description>&lt;P&gt;Why don't you use the correct format in the first %sysfunc call?&lt;/P&gt;
&lt;P&gt;Not sure why you need all this logic, why not&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let otherdate = 01Jan%substr(&amp;amp;sysdate9,6,4);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;untested...&lt;/P&gt;</description>
    <pubDate>Thu, 08 Mar 2018 14:44:04 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2018-03-08T14:44:04Z</dc:date>
    <item>
      <title>sysfunc to convert SAS date does not work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sysfunc-to-convert-SAS-date-does-not-work/m-p/443769#M111043</link>
      <description>&lt;P&gt;&amp;nbsp;Hi,&lt;/P&gt;&lt;P&gt;I'd like to convert the macro variable sasdate to date9. format, but I can't get this to work.&lt;/P&gt;&lt;P&gt;I get the message below and i don't know what this message means.&lt;/P&gt;&lt;P&gt;Anyone ?&lt;/P&gt;&lt;P&gt;Thanks very much !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;21&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let sasdate=%sysfunc(intnx(year,%sysfunc(today()),0));&lt;BR /&gt;22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let otherdate = %sysfunc(INPUTN(&amp;amp;sasdate., YYMMDD8.), date9.);&lt;BR /&gt;WARNING: Argument 1 to function INPUTN referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 14:33:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sysfunc-to-convert-SAS-date-does-not-work/m-p/443769#M111043</guid>
      <dc:creator>Billybob73</dc:creator>
      <dc:date>2018-03-08T14:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: sysfunc to convert SAS date does not work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sysfunc-to-convert-SAS-date-does-not-work/m-p/443775#M111046</link>
      <description>&lt;P&gt;Why don't you use the correct format in the first %sysfunc call?&lt;/P&gt;
&lt;P&gt;Not sure why you need all this logic, why not&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let otherdate = 01Jan%substr(&amp;amp;sysdate9,6,4);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;untested...&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 14:44:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sysfunc-to-convert-SAS-date-does-not-work/m-p/443775#M111046</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-03-08T14:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: sysfunc to convert SAS date does not work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sysfunc-to-convert-SAS-date-does-not-work/m-p/443778#M111048</link>
      <description>&lt;P&gt;Why?&amp;nbsp; As:&lt;/P&gt;
&lt;PRE&gt;%put %sysfunc(today(),date9.);&lt;/PRE&gt;
&lt;P&gt;You only need to specify the format in the call...&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 15:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sysfunc-to-convert-SAS-date-does-not-work/m-p/443778#M111048</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-03-08T15:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: sysfunc to convert SAS date does not work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sysfunc-to-convert-SAS-date-does-not-work/m-p/443784#M111050</link>
      <description>&lt;P&gt;As soon as I see two or more %sysfunc's in a single line of code, I go data step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
sasdate = intnx('year',today(),0,'b');
call symput('otherdate',put(sasdate,date9.));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 15:19:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sysfunc-to-convert-SAS-date-does-not-work/m-p/443784#M111050</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-08T15:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: sysfunc to convert SAS date does not work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sysfunc-to-convert-SAS-date-does-not-work/m-p/443786#M111051</link>
      <description>&lt;P&gt;Your first step is generating a raw date value. The number of days since 1/1/1960.&lt;/P&gt;
&lt;P&gt;So the second step needs to use the PUTN() function to apply a format.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let otherdate = %sysfunc(PUTN(&amp;amp;sasdate., date9.));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or you could generate the value using YYMMDDn8. format to begin with.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let sasdate=%sysfunc(intnx(year,%sysfunc(today()),0),yymmddn8);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then your INPUTN() function call should work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 15:18:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sysfunc-to-convert-SAS-date-does-not-work/m-p/443786#M111051</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-08T15:18:49Z</dc:date>
    </item>
  </channel>
</rss>

