<?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: NULL SAS Dates and Case Statement in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589840#M34691</link>
    <description>&lt;P&gt;If you want a missing value to appear as a specific string then create a custom format that assigns such.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;But the answers you have made to other posts tell me it is time for you to share actual input data and what&amp;nbsp; you actually expect to be the data values. It appears that you may be confuse as this doesn't make much sense:&lt;BR /&gt;to change it back to MMDDYY10&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change what? Perhaps you need an explicit format assignment:&lt;/P&gt;
&lt;PRE&gt;Case

   when missing(date) then "01jan1900"d
   else date
end  as date format=mmddyy10.
&lt;/PRE&gt;</description>
    <pubDate>Wed, 18 Sep 2019 21:24:16 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-09-18T21:24:16Z</dc:date>
    <item>
      <title>NULL SAS Dates and Case Statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589688#M34685</link>
      <description>&lt;P&gt;I have a variable with about 5 missing dates out of 250K claims.&amp;nbsp; I want to default this date to 01jan1900.&amp;nbsp; When I try this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Case&lt;/P&gt;
&lt;P&gt;when date is missing&lt;/P&gt;
&lt;P&gt;then "01jan1900"d&lt;/P&gt;
&lt;P&gt;else date&lt;/P&gt;
&lt;P&gt;end&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It returns as a numeric variable.&amp;nbsp; When I try to put a PUT/INPUT around it to change it back to MMDDYY10. it will be blank all the way through.&amp;nbsp; Any help is appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Andrew&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 15:00:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589688#M34685</guid>
      <dc:creator>sasspan</dc:creator>
      <dc:date>2019-09-18T15:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: NULL SAS Dates and Case Statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589691#M34686</link>
      <description>&lt;P&gt;If you want char&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Case

when date is missing

then put( "01jan1900"d,date9.)

else date

end&amp;nbsp;as&amp;nbsp;var&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;if you want to just format to display the numeric&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Case

when date is missing

then "01jan1900"d 

else date

end as var format=date9.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Sep 2019 15:03:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589691#M34686</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-18T15:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: NULL SAS Dates and Case Statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589698#M34687</link>
      <description>I don't want char or numeric. I want the result to be in date format. I've&lt;BR /&gt;tried both of your solutions before. I can't make it an actual date value.&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Sep 2019 15:14:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589698#M34687</guid>
      <dc:creator>sasspan</dc:creator>
      <dc:date>2019-09-18T15:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: NULL SAS Dates and Case Statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589699#M34688</link>
      <description>&lt;P&gt;Alright. Please clarify what do you mean by Actual date value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS dates are continuous numbers(i,.e integers) starting from 0 on '01jan1960'd till date. You can use a format/in=format with put/input to either store the dates as char or read char to num respectively.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 15:17:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589699#M34688</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-18T15:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: NULL SAS Dates and Case Statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589700#M34689</link>
      <description>&lt;P&gt;SAS variables have to be either character or numeric.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you want it to be in DATE9. format, then it must be a numeric variable.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 15:18:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589700#M34689</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-18T15:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: NULL SAS Dates and Case Statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589840#M34691</link>
      <description>&lt;P&gt;If you want a missing value to appear as a specific string then create a custom format that assigns such.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;But the answers you have made to other posts tell me it is time for you to share actual input data and what&amp;nbsp; you actually expect to be the data values. It appears that you may be confuse as this doesn't make much sense:&lt;BR /&gt;to change it back to MMDDYY10&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change what? Perhaps you need an explicit format assignment:&lt;/P&gt;
&lt;PRE&gt;Case

   when missing(date) then "01jan1900"d
   else date
end  as date format=mmddyy10.
&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Sep 2019 21:24:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589840#M34691</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-18T21:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: NULL SAS Dates and Case Statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589842#M34692</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35915"&gt;@sasspan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a variable with about 5 missing dates out of 250K claims.&amp;nbsp; I want to default this date to 01jan1900.&amp;nbsp; When I try this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Case&lt;/P&gt;
&lt;P&gt;when date is missing&lt;/P&gt;
&lt;P&gt;then "01jan1900"d&lt;/P&gt;
&lt;P&gt;else date&lt;/P&gt;
&lt;P&gt;end&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It returns as a numeric variable.&amp;nbsp; When I try to put a PUT/INPUT around it to change it back to MMDDYY10. it will be blank all the way through.&amp;nbsp; Any help is appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Andrew&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The CASE block is making a NEW variable, it will not retain any attributes of the original DATE variable. So if you want a specific FORMAT attached to the variable you need to tell SAS that.&amp;nbsp; Same thing if you want a specific LABEL attached to this new variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case .... end as new_varname format=yymmdd10.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS Try to avoid M-D-Y or D-M-Y order for dates. Which ever one you pick will confuse half of you audience.&amp;nbsp; Stick with DATE9 or YYMMDD10 formats to avoid misunderstandings.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 21:31:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589842#M34692</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-18T21:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: NULL SAS Dates and Case Statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589848#M34693</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;PS Try to avoid M-D-Y or D-M-Y order for dates. Which ever one you pick will confuse half of you audience.&amp;nbsp; Stick with DATE9 or YYMMDD10 formats to avoid misunderstandings.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;Let's not forget the wonderful Julian date: 19262 for today! ( Really wanted one of the "devil" emoticons to go with this one).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For those Julian date impaired that date is the same as 18Sep2019 (or 18 September of any year that isn't a leap year)&amp;nbsp;. Julian dates are number of day in the year preceded by a 2 or 4 digit year.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 21:59:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/NULL-SAS-Dates-and-Case-Statement/m-p/589848#M34693</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-18T21:59:43Z</dc:date>
    </item>
  </channel>
</rss>

