<?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: Date format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-format/m-p/522808#M141993</link>
    <description>&lt;P&gt;You are extracting &lt;FONT size="3"&gt;&lt;STRONG&gt;8&lt;/STRONG&gt;&lt;/FONT&gt; bytes with the substr(), but use a format that has a default length of &lt;STRONG&gt;&lt;FONT size="3"&gt;9&lt;/FONT&gt;&lt;/STRONG&gt;. That alone should get you to thinking.&lt;/P&gt;
&lt;P&gt;And then you should &lt;FONT color="#3366FF" size="3"&gt;&lt;STRONG&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=leforinforref&amp;amp;docsetTarget=n0verk17pchh4vn1akrrv0b5w3r0.htm&amp;amp;locale=en" target="_blank"&gt;READ THE DOCUMENTATION&lt;/A&gt;&lt;/STRONG&gt;&lt;/FONT&gt; (section date and time) of the formats, so you see which one to use. &lt;FONT size="3"&gt;&lt;STRONG&gt;DO IT NOW&lt;/STRONG&gt;&lt;/FONT&gt;. It is not rocket science, and it won't make your brain explode. Promise.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Dec 2018 08:13:24 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-12-20T08:13:24Z</dc:date>
    <item>
      <title>Date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-format/m-p/522801#M141990</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran the following program and got the error as below. Appreciate if someone of you guide me to get the desired output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test;
%let sysparm=D20181207:00:00:00*N*N ;
%let glb_runcode = %substr(&amp;amp;sysparm,2,8);
%put glb_runcode = &amp;amp;glb_runcode ; 
%let glb_runcode_date=%sysfunc(inputn(&amp;amp;glb_runcode,date9.));
%put glb_runcode_date = &amp;amp;glb_runcode_date ; 
%mend;

%test;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;4         %macro test;
25         %let sysparm=D20181207:00:00:00*N*N ;
26         %let glb_runcode = %substr(&amp;amp;sysparm,2,8);
27         %put glb_runcode = &amp;amp;glb_runcode ;
28         %let glb_runcode_date=%sysfunc(inputn(&amp;amp;glb_runcode,date9.));
29         %put glb_runcode_date = &amp;amp;glb_runcode_date ;
30         %mend;
31         
32         %test;
glb_runcode = 20181207
WARNING: Argument 1 to function INPUTN referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.
NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The result of the operations have been set 
      to a missing value.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;U&gt;Desired Output:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;glb_runcode_date = 7dec2018&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 06:41:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-format/m-p/522801#M141990</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-12-20T06:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-format/m-p/522803#M141991</link>
      <description>&lt;P&gt;Try this..&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test;
%let sysparm=D20181207:00:00:00*N*N ;
%let glb_runcode = %substr(&amp;amp;sysparm,2,8);
%put glb_runcode = &amp;amp;glb_runcode ; 
%let glb_runcode_date=%sysfunc(inputn(&amp;amp;glb_runcode,yymmdd8.), date9.);
%put glb_runcode_date = &amp;amp;glb_runcode_date ; 
%mend;

%test;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Dec 2018 07:14:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-format/m-p/522803#M141991</guid>
      <dc:creator>ShiroAmada</dc:creator>
      <dc:date>2018-12-20T07:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-format/m-p/522808#M141993</link>
      <description>&lt;P&gt;You are extracting &lt;FONT size="3"&gt;&lt;STRONG&gt;8&lt;/STRONG&gt;&lt;/FONT&gt; bytes with the substr(), but use a format that has a default length of &lt;STRONG&gt;&lt;FONT size="3"&gt;9&lt;/FONT&gt;&lt;/STRONG&gt;. That alone should get you to thinking.&lt;/P&gt;
&lt;P&gt;And then you should &lt;FONT color="#3366FF" size="3"&gt;&lt;STRONG&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=leforinforref&amp;amp;docsetTarget=n0verk17pchh4vn1akrrv0b5w3r0.htm&amp;amp;locale=en" target="_blank"&gt;READ THE DOCUMENTATION&lt;/A&gt;&lt;/STRONG&gt;&lt;/FONT&gt; (section date and time) of the formats, so you see which one to use. &lt;FONT size="3"&gt;&lt;STRONG&gt;DO IT NOW&lt;/STRONG&gt;&lt;/FONT&gt;. It is not rocket science, and it won't make your brain explode. Promise.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 08:13:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-format/m-p/522808#M141993</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-20T08:13:24Z</dc:date>
    </item>
  </channel>
</rss>

