<?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 stored as $6. need to convet to mmddyy8.  ?? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-stored-as-6-need-to-convert-to-mmddyy8/m-p/267259#M52801</link>
    <description>Yep, no one works here anymore from this time line when the data was created.   We think that 999999 000000 mean special things.  For example 999999 no end date or TBA and 000000 might be unknown start date or something like that…  but until we are sure we are going to keep the original field in the data set as a new name and then join the corrected field with all the other year data sets.   Thanks for the advice. Have a great day!</description>
    <pubDate>Fri, 29 Apr 2016 15:20:56 GMT</pubDate>
    <dc:creator>kjohnsonm</dc:creator>
    <dc:date>2016-04-29T15:20:56Z</dc:date>
    <item>
      <title>Date stored as $6. need to convert to mmddyy8.  ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-stored-as-6-need-to-convert-to-mmddyy8/m-p/267145#M52755</link>
      <description>&lt;P&gt;Hello All,&lt;BR /&gt;&lt;BR /&gt;I have an old dataset I am reading from a DBF file it has 6 fields that are dates and they each are showing data type at "$6." no quotes in proc contents.&amp;nbsp;&amp;nbsp; I need to get them into mmddyy8. Can someone help me figure this out?&lt;BR /&gt;&lt;BR /&gt;The strings are clean save there are some that are null and some that have 000000 or 999999.&amp;nbsp; Otherwise they are 100 percent clean with the format yymmdd&amp;nbsp; (no delimiter)&lt;BR /&gt;&lt;BR /&gt;I can parse the field into yy mm and dd then recombine it in any order I need.&lt;BR /&gt;&lt;BR /&gt;but just have no idea where to go from here...&amp;nbsp; (or if parsing is needed)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
length BEGIN_DATEn $8.;
/*length BEGIN_DATEz 8.;*/
set original;
BEGIN_DATEn=input(substr(strip(BEGIN_DATE),3,2),$2.)||"/"||input(substr(strip(BEGIN_DATE),5,2),$2.)||"/"||input(substr(strip(BEGIN_DATE),1,2),$2.);
BEGIN_DATEz=input(BEGIN_DATEn,mmddyy.8);
format BEGIN_DATEz mmddyy8.;
run;
proc print data=temp (obs=500);
var BEGIN_DATE BEGIN_DATEn 
/*BEGIN_DATEz*/
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;... and yep have not tried to deal with the blanks or 999999 or 000000 data yet, I can't get dates to work for one field that is clean without these issues...&amp;nbsp; d'oh!&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TIA -kj&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2016 15:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-stored-as-6-need-to-convert-to-mmddyy8/m-p/267145#M52755</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2016-04-29T15:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Date stored as $6. need to convet to mmddyy8.  ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-stored-as-6-need-to-convert-to-mmddyy8/m-p/267151#M52756</link>
      <description>&lt;P&gt;999999 or 000000 or blank is easy to tackle, I will leave it for you. Before the code, I want to inform you of system option YEARCUTOFF, depending on your data, it may make a big difference, google it and make it right for you if the default (YEARCUTOFF=1920) does not suit you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the clean ones:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;23         data _null_;
24         old='050131';
25         new=input(old,yymmdd6.);
26         format new mmddyy8.;
27         put new=;
28         run;

new=01/31/05&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Apr 2016 01:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-stored-as-6-need-to-convert-to-mmddyy8/m-p/267151#M52756</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2016-04-29T01:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Date stored as $6. need to convet to mmddyy8.  ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-stored-as-6-need-to-convert-to-mmddyy8/m-p/267254#M52798</link>
      <description>&lt;P&gt;What you need to know is if the 000000 or 999999 mean specific types of missing values such as "not recorded" or "invalid collected&amp;nbsp;date"&amp;nbsp;so you can treat them appropriately.&lt;/P&gt;
&lt;P&gt;What &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4877"&gt;@Haikuo﻿&lt;/a&gt;&amp;nbsp;didn't explicitly say is that since the special values are not valid dates they will result in missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the concept of special missing values may apply if you might need to treat those values differently in the future.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2016 14:56:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-stored-as-6-need-to-convert-to-mmddyy8/m-p/267254#M52798</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-04-29T14:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Date stored as $6. need to convet to mmddyy8.  ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-stored-as-6-need-to-convert-to-mmddyy8/m-p/267257#M52800</link>
      <description>&lt;P&gt;I sure was making it harder than it needed to be...&lt;/P&gt;
&lt;P&gt;It seems to me I need to learn the order of operation for data steps.&amp;nbsp; Thanks for your help with this.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2016 15:14:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-stored-as-6-need-to-convert-to-mmddyy8/m-p/267257#M52800</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2016-04-29T15:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Date stored as $6. need to convet to mmddyy8.  ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-stored-as-6-need-to-convert-to-mmddyy8/m-p/267259#M52801</link>
      <description>Yep, no one works here anymore from this time line when the data was created.   We think that 999999 000000 mean special things.  For example 999999 no end date or TBA and 000000 might be unknown start date or something like that…  but until we are sure we are going to keep the original field in the data set as a new name and then join the corrected field with all the other year data sets.   Thanks for the advice. Have a great day!</description>
      <pubDate>Fri, 29 Apr 2016 15:20:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-stored-as-6-need-to-convert-to-mmddyy8/m-p/267259#M52801</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2016-04-29T15:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Date stored as $6. need to convet to mmddyy8.  ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-stored-as-6-need-to-convert-to-mmddyy8/m-p/267711#M52930</link>
      <description>&lt;P&gt;Here is an example of possible&amp;nbsp;use of special missing with your data.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format library=work;
invalue SpecialDate
000000=.S
999999=.E
other=[MMDDYY6.]
;
Value SpecialDate
.S = 'Missing Start Date'
.E = 'Missing End Date'
other= [MMDDYY10.]
;
run;

data example  ;
   informat mydate SpecialDate.;
   Format Mydate SpecialDate.;
   input mydate;
datalines;
000000
999999
050613
041210
121212
;
run;

proc print data=example noobs;
   format mydate SpecialDate;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;One warning with use of special missing: Some procedures will treat these differently than simple missing such as counts in Proc freq.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the technique is well worth knowing when you get coded values mixed in with others.&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2016 20:18:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-stored-as-6-need-to-convert-to-mmddyy8/m-p/267711#M52930</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-02T20:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Date stored as $6. need to convet to mmddyy8.  ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-stored-as-6-need-to-convert-to-mmddyy8/m-p/267735#M52942</link>
      <description>&lt;P&gt;That is very cool.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=example noobs;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The SAS System&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14:14 Monday, May 2, 2016&amp;nbsp; 21&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mydate&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Missing Start Date&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Missing End Date&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05/06/2013&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04/12/2010&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12/12/2012&lt;/P&gt;
&lt;P&gt;I would not have thought to look for any commands like this.&amp;nbsp; Thank you very much.&amp;nbsp; -KJ&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2016 21:34:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-stored-as-6-need-to-convert-to-mmddyy8/m-p/267735#M52942</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2016-05-02T21:34:49Z</dc:date>
    </item>
  </channel>
</rss>

