<?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 SAS Date format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/704991#M216164</link>
    <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a variable DATE_E1 which is in date format and value is&amp;nbsp;20170410 or 2020007. I need to print this value exactly as 10-Apr-17 or 7-Feb-20&amp;nbsp; .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me with the code&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Dec 2020 09:10:31 GMT</pubDate>
    <dc:creator>ss171</dc:creator>
    <dc:date>2020-12-10T09:10:31Z</dc:date>
    <item>
      <title>SAS Date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/704991#M216164</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a variable DATE_E1 which is in date format and value is&amp;nbsp;20170410 or 2020007. I need to print this value exactly as 10-Apr-17 or 7-Feb-20&amp;nbsp; .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me with the code&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 09:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/704991#M216164</guid>
      <dc:creator>ss171</dc:creator>
      <dc:date>2020-12-10T09:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/704996#M216167</link>
      <description>&lt;P&gt;You need to write your own &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=proc&amp;amp;docsetTarget=p0n990vq8gxca6n1vnsracr6jp2c.htm&amp;amp;locale=en" target="_self"&gt;picture format.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Use:&lt;/P&gt;
&lt;H4 class="xisDoc-argument"&gt;%j for the day&lt;/H4&gt;
&lt;H4 class="xisDoc-argument"&gt;%3B for the month&lt;/H4&gt;
&lt;H4 class="xisDoc-argument"&gt;%y for the year&amp;nbsp;&lt;/H4&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 09:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/704996#M216167</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-12-10T09:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/705022#M216181</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried but getting ERROR printed in output. Please let me know why&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input date;
cards;
20201210
20170517
;
run;
  proc format;
        picture mydate
                low-high='%j-%3B-%y' (datatype=date);
     run;

 proc print data=a; 
 format date mydate.;
     run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Output :&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Obs&lt;/TD&gt;&lt;TD&gt;date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;ERROR&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;ERROR&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 11:27:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/705022#M216181</guid>
      <dc:creator>ss171</dc:creator>
      <dc:date>2020-12-10T11:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/705023#M216182</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/300897"&gt;@ss171&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried but getting ERROR printed in output. Please let me know why&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input date;
cards;
20201210
20170517
;
run;
  proc format;
        picture mydate
                low-high='%j-%3B-%y' (datatype=date);
     run;

 proc print data=a; 
 format date mydate.;
     run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Output :&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;Obs&lt;/TD&gt;
&lt;TD&gt;date&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;ERROR&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;ERROR&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your dates in data set named A are not recognized by SAS as an actual date. SAS dates are integers that represent the number of days since 01JAN1960. Your dates are integers, but only recognizable by humans as actual dates, not by SAS. This is a crucial point if you are going to be using SAS dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To make these dates recognizable by SAS, use an informat :YYMMDD8. in the INPUT statement. (or you can use the INPUT function)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
    picture mydate low-high='%d-%3B-%y' (datatype=date);
run;
data a;
input date :yymmdd8.;
format date mydate.;
cards;
20201210
20170517
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; Also please note that %y in the picture format must be lower case&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 11:55:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/705023#M216182</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-12-10T11:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/705031#M216188</link>
      <description>Thanks for your help</description>
      <pubDate>Thu, 10 Dec 2020 13:11:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-format/m-p/705031#M216188</guid>
      <dc:creator>ss171</dc:creator>
      <dc:date>2020-12-10T13:11:40Z</dc:date>
    </item>
  </channel>
</rss>

