<?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/848271#M335369</link>
    <description>&lt;P&gt;I was searching for 45 mins for the solution to this exact problem and this worked for me. Thank you so much!!!&lt;/P&gt;</description>
    <pubDate>Wed, 07 Dec 2022 03:51:52 GMT</pubDate>
    <dc:creator>zaval025</dc:creator>
    <dc:date>2022-12-07T03:51:52Z</dc:date>
    <item>
      <title>Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/702495#M215171</link>
      <description>&lt;P&gt;Hi Everyone&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to format a numeric date field from '2020-11-30' to Date9. 30NOV2020.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below query is not working :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want&lt;BR /&gt;set need&lt;/P&gt;&lt;P&gt;New_Date = input(Date, DDMMYYD10.);&lt;BR /&gt;format New_Date&amp;nbsp; date9.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 13:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/702495#M215171</guid>
      <dc:creator>Ela_84</dc:creator>
      <dc:date>2020-11-30T13:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/702496#M215172</link>
      <description>&lt;P&gt;you do not need to convert as your var is already numeric. Just format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want&lt;BR /&gt;set need&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;New_Date = input(Date, DDMMYYD10.);&lt;/STRIKE&gt;&lt;BR /&gt;format date date9.;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 13:35:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/702496#M215172</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-11-30T13:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/702498#M215173</link>
      <description>I get the below error&lt;BR /&gt;&lt;BR /&gt;27 format Date Date9.;&lt;BR /&gt;______&lt;BR /&gt;484&lt;BR /&gt;NOTE 484-185: Format $DATE was not found or could not be loaded.</description>
      <pubDate>Mon, 30 Nov 2020 13:40:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/702498#M215173</guid>
      <dc:creator>Ela_84</dc:creator>
      <dc:date>2020-11-30T13:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/702499#M215174</link>
      <description>&lt;P&gt;Can you do a PROC CONTENTS and check the data type of the variable plz .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Proc CONTENTS report will contain information about the metadata or for easy understanding so called properties. Should your Date be character, you would of course need to convert to a numeric SAS date and assign to a new variable that is of type numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/223624"&gt;@Ela_84&lt;/a&gt;&amp;nbsp;If it all your date is of type char, it may appear your dates are in the from YYMMDD, and therefore the appropriate INFORMAT needed to convert to numeric would also be &lt;STRONG&gt;YYMMDD10.&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So basically,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data test;
 char_Date='2020-11-30';
 num_sas_date=input(char_date,yymmdd10.);/*convert to numeric and save in a new var*/
 format num_sas_date date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 14:10:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/702499#M215174</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-11-30T14:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/702501#M215175</link>
      <description>&lt;P&gt;You need to use a valid INFORMAT with the INPUT() function. There is no informat named DDMMYYD.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also if the strings follow the pattern YYYY-MM-DD then you want to use the YYMMDD10. informat.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 13:51:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/702501#M215175</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-30T13:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/848271#M335369</link>
      <description>&lt;P&gt;I was searching for 45 mins for the solution to this exact problem and this worked for me. Thank you so much!!!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 03:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/848271#M335369</guid>
      <dc:creator>zaval025</dc:creator>
      <dc:date>2022-12-07T03:51:52Z</dc:date>
    </item>
  </channel>
</rss>

