<?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: What is the proper informat for SAS to extract date values? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/What-is-the-proper-informat-for-SAS-to-extract-date-values/m-p/685873#M24343</link>
    <description>&lt;P&gt;You are correct about SAS dates being numeric with 0 being Jan 1 1960.&amp;nbsp; So, the format you need is just a numeric format long enough for the value.&amp;nbsp; 5.0 works in this example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;  
  birthdate = mdy(1,1,1960);
  put birthdate =;
run;

proc print data=have;
  format birthdate 5.0;
run;&lt;/PRE&gt;</description>
    <pubDate>Tue, 22 Sep 2020 20:43:35 GMT</pubDate>
    <dc:creator>CurtisMackWSIPP</dc:creator>
    <dc:date>2020-09-22T20:43:35Z</dc:date>
    <item>
      <title>What is the proper informat for SAS to extract date values?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-is-the-proper-informat-for-SAS-to-extract-date-values/m-p/685868#M24342</link>
      <description>&lt;P&gt;My Code:&lt;/P&gt;&lt;P&gt;DATA IowaResidents;&lt;BR /&gt;INFILE "IowaResidents.csv" DELIMITER = ',' DSD;&lt;BR /&gt;INPUT SSN :$11.&lt;BR /&gt;Initials :$4.&lt;BR /&gt;City :$20.&lt;BR /&gt;State :$4.&lt;BR /&gt;ZipCd&lt;BR /&gt;Sex :$6.&lt;BR /&gt;Ethnicity :$12.&lt;BR /&gt;Race :$5.&lt;BR /&gt;BirthDt :MMDDYY10.;&lt;BR /&gt;RUN;&lt;BR /&gt;PROC PRINT DATA = IowaResidents;&lt;BR /&gt;FORMAT BirthDt &lt;FONT color="#FFCC00"&gt;______&lt;/FONT&gt;.;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need BirthDt to display in PROC PRINT as a numeric variable with the first observation being 10622. This example gives me reason to believe that it is a SAS date value. What is the proper informat that I can use in the FORMAT BirthDT ____ that will display the MMDDYY birth date as days since January 1,1960?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-is-the-proper-informat-for-SAS-to-extract-date-values/m-p/685868#M24342</guid>
      <dc:creator>mwhemke</dc:creator>
      <dc:date>2020-12-10T15:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: What is the proper informat for SAS to extract date values?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-is-the-proper-informat-for-SAS-to-extract-date-values/m-p/685873#M24343</link>
      <description>&lt;P&gt;You are correct about SAS dates being numeric with 0 being Jan 1 1960.&amp;nbsp; So, the format you need is just a numeric format long enough for the value.&amp;nbsp; 5.0 works in this example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;  
  birthdate = mdy(1,1,1960);
  put birthdate =;
run;

proc print data=have;
  format birthdate 5.0;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Sep 2020 20:43:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-is-the-proper-informat-for-SAS-to-extract-date-values/m-p/685873#M24343</guid>
      <dc:creator>CurtisMackWSIPP</dc:creator>
      <dc:date>2020-09-22T20:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: What is the proper informat for SAS to extract date values?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-is-the-proper-informat-for-SAS-to-extract-date-values/m-p/685874#M24344</link>
      <description>&lt;P&gt;10622 IS most probably the number of days since 1960-01-01 for your birthdate. If you want to display it as a human-readable date, use one of the date formats like the MMDDYY you already mentioned. To simply display the raw number, assign no format at all, and SAS will use the default BEST12. format.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 20:44:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-is-the-proper-informat-for-SAS-to-extract-date-values/m-p/685874#M24344</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-22T20:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: What is the proper informat for SAS to extract date values?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-is-the-proper-informat-for-SAS-to-extract-date-values/m-p/685879#M24345</link>
      <description>&lt;P&gt;Just what date is 10622 supposed to be?&lt;/P&gt;
&lt;P&gt;If that is a SAS date value as implied by your code that would be 01/30/1989 and you would use the &lt;STRONG&gt;format&lt;/STRONG&gt; MMDDYY10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Formats display. Informats read.&lt;/P&gt;
&lt;P&gt;If that is not the expected result for 10622 then you need to provide some details, such as what your RAW data from the CSV looks like. Hint: DO NOT open the CSV in a spreadsheet. Open the CSV file with a text editor like Notepad, copy a few lines of the data and then paste the copied lines into a code box opened on the forum with the &amp;lt;/&amp;gt; to preserve actual format of your data. The main message windows will reformat text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you have some sensitive data XXXX out the SSN values.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 20:50:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-is-the-proper-informat-for-SAS-to-extract-date-values/m-p/685879#M24345</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-22T20:50:05Z</dc:date>
    </item>
  </channel>
</rss>

