<?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: Converting Main frame dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Converting-Main-frame-dates/m-p/663880#M198273</link>
    <description>I like the solution below that I found on the web. Here's the link that will credit the source and explain the solution:&lt;BR /&gt;&lt;A href="https://www.experts-exchange.com/questions/28126605/Coverting-data-from-CYYMMDD-to-MM-DD-YYYY-in-SAS.html" target="_blank"&gt;https://www.experts-exchange.com/questions/28126605/Coverting-data-from-CYYMMDD-to-MM-DD-YYYY-in-SAS.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;data date;&lt;BR /&gt;date_str = "1050527";&lt;BR /&gt;IF date_str = : "2" then date_str2 = "20"||SUBSTR(date_str,2);&lt;BR /&gt;ELSE date_str2 = "19"||SUBSTR(date_str,2);&lt;BR /&gt;&lt;BR /&gt;date = input(date_str2, yymmdd8.);&lt;BR /&gt;/* if you wish to store the converted value as a SAS date displayed as mm/dd/yyyy */&lt;BR /&gt;format date mmddyys10.;&lt;BR /&gt;/* if you wish to store the converted value as a character displayed as mm/dd/yyyy */&lt;BR /&gt;new_date_str = put(date, mmddyys10.);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Sun, 21 Jun 2020 21:25:20 GMT</pubDate>
    <dc:creator>Nicole_Fox</dc:creator>
    <dc:date>2020-06-21T21:25:20Z</dc:date>
    <item>
      <title>Converting Main frame dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-Main-frame-dates/m-p/663874#M198270</link>
      <description>&lt;P&gt;I have a mainframe date as 1200617 and I want to use the same date in my base sas to do a data filtration.&lt;/P&gt;&lt;P&gt;Can anyone please help how can I convert this date to use in a base sas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 20:58:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-Main-frame-dates/m-p/663874#M198270</guid>
      <dc:creator>kajal_30</dc:creator>
      <dc:date>2020-06-21T20:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Main frame dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-Main-frame-dates/m-p/663880#M198273</link>
      <description>I like the solution below that I found on the web. Here's the link that will credit the source and explain the solution:&lt;BR /&gt;&lt;A href="https://www.experts-exchange.com/questions/28126605/Coverting-data-from-CYYMMDD-to-MM-DD-YYYY-in-SAS.html" target="_blank"&gt;https://www.experts-exchange.com/questions/28126605/Coverting-data-from-CYYMMDD-to-MM-DD-YYYY-in-SAS.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;data date;&lt;BR /&gt;date_str = "1050527";&lt;BR /&gt;IF date_str = : "2" then date_str2 = "20"||SUBSTR(date_str,2);&lt;BR /&gt;ELSE date_str2 = "19"||SUBSTR(date_str,2);&lt;BR /&gt;&lt;BR /&gt;date = input(date_str2, yymmdd8.);&lt;BR /&gt;/* if you wish to store the converted value as a SAS date displayed as mm/dd/yyyy */&lt;BR /&gt;format date mmddyys10.;&lt;BR /&gt;/* if you wish to store the converted value as a character displayed as mm/dd/yyyy */&lt;BR /&gt;new_date_str = put(date, mmddyys10.);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 21 Jun 2020 21:25:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-Main-frame-dates/m-p/663880#M198273</guid>
      <dc:creator>Nicole_Fox</dc:creator>
      <dc:date>2020-06-21T21:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Main frame dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-Main-frame-dates/m-p/663882#M198275</link>
      <description>&lt;P&gt;Why are you asking again? The answer was &lt;A href="https://communities.sas.com/t5/SAS-Programming/Converting-ddmmmyyyy-date-to-SAS-Date/m-p/663390#M198021" target="_self"&gt;given&lt;/A&gt; (please choose an answer in the other thread) :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
  *Format cYYMMDD - c= century number:  0 for 1800, 1 for 1900, 2 for 2000 ;       
  DATE =  1990401 ;
  DATEZ = input(put(18000000+DATE,z8.),yymmdd8.);
  format DATEZ date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It looks like for you, if&amp;nbsp;&lt;SPAN&gt;C = 0 then it's 1900 and if C = 1 it's 2000, like &lt;A href="https://www.ibm.com/mysupport/s/question/0D50z000060GTZx/date-in-cyymmdd-format-manipulation?language=en_US" target="_self"&gt;here&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So you need to add 19000000.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is this what you mean?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 21:29:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-Main-frame-dates/m-p/663882#M198275</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-06-21T21:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Main frame dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-Main-frame-dates/m-p/664126#M198369</link>
      <description>&lt;P&gt;May I know the criteria for adding 18000000 or 19000000 ?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 03:03:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-Main-frame-dates/m-p/664126#M198369</guid>
      <dc:creator>kajal_30</dc:creator>
      <dc:date>2020-06-23T03:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Main frame dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-Main-frame-dates/m-p/664131#M198373</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; May I know the criteria for adding 18000000 or 19000000 ?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Do you want a date starting with 120&amp;nbsp; to be 1920 or 2020?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 03:52:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-Main-frame-dates/m-p/664131#M198373</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-06-23T03:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Main frame dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-Main-frame-dates/m-p/664263#M198409</link>
      <description>&lt;P&gt;I want it to be 2020&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 12:58:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-Main-frame-dates/m-p/664263#M198409</guid>
      <dc:creator>kajal_30</dc:creator>
      <dc:date>2020-06-23T12:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Main frame dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-Main-frame-dates/m-p/664273#M198413</link>
      <description>&lt;P&gt;In case mainframe data has both old and new records and we have no idea if they are from year 2020 or 1900 is there a generic way to convert them into SAS dates?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 13:28:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-Main-frame-dates/m-p/664273#M198413</guid>
      <dc:creator>kajal_30</dc:creator>
      <dc:date>2020-06-23T13:28:27Z</dc:date>
    </item>
  </channel>
</rss>

