<?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: how to convert date 2020-10-12( numeric) to 2020-10-12( character) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689956#M209807</link>
    <description>&lt;P&gt;I tried it but it still says invalid numeric data for some reason. this is the column attributes in my dataset. row 8, 9 have missing values ".". where as row 10 has the date in ddmmyy10. I&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_0-1602162151711.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50352i56B0487526F5E24F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASuserlot_0-1602162151711.png" alt="SASuserlot_0-1602162151711.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;want to replace"." with "Missing"&lt;/P&gt;</description>
    <pubDate>Thu, 08 Oct 2020 13:02:41 GMT</pubDate>
    <dc:creator>SASuserlot</dc:creator>
    <dc:date>2020-10-08T13:02:41Z</dc:date>
    <item>
      <title>how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689806#M209719</link>
      <description>&lt;P&gt;how to convert numeric date to character date and display same way as mentioned above. I need it because there are missing dates where I need place "Missing" which is character&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 01:54:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689806#M209719</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T01:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689820#M209724</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;IF    MISSING(Numeric_Date)  THEN
    Character_Date = 'Missing';
ELSE
    Character_Date = Put(Numeric_Date, mmddyyd10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 15:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689820#M209724</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-08T15:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689825#M209728</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;c5=input(strtd ,32.)+ '30dec1899'd;/* excel has the character so the date converted to charcter "days"*/
format c5 yymmdd10.;										/*changing back to numeric and date 11*/

if missing(c5) then c5="[Missing]";
else c5=put(c5,mmddyyd10.);&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
      9276:24   9277:9
NOTE: Invalid numeric data, '09-27-2012' , at line 9277 column 9.&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Oct 2020 02:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689825#M209728</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T02:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689829#M209732</link>
      <description>&lt;P&gt;You can't use c5 for numeric and character purposes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This cannot work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;c5=input(strtd ,32.)+ '30dec1899'd;/* excel has the character so the date converted to charcter "days"*/
format c5 yymmdd10.;										/*changing back to numeric and date 11*/

if missing(c5) then c5="[Missing]";
else c5=put(c5,mmddyyd10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have to have a &lt;STRONG&gt;character&lt;/STRONG&gt; variable to contain things like "[Missing]"&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;c5=input(strtd ,32.)+ '30dec1899'd;/* excel has the character so the date converted to charcter "days"*/
format c5 yymmdd10.;										/*changing back to numeric and date 11*/

if missing(c5) then c5_char ="[Missing]";
else c5_char = put(c5, mmddyyd10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 02:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689829#M209732</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-08T02:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689837#M209738</link>
      <description>&lt;P&gt;understand is there any possible way I can do the display like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_0-1602126363329.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50343i22B07FC6452FBDB2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASuserlot_0-1602126363329.png" alt="SASuserlot_0-1602126363329.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 03:06:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689837#M209738</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T03:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689853#M209750</link>
      <description>&lt;P&gt;No need to "convert" anything.&lt;/P&gt;
&lt;P&gt;Create a custom format and use that with the date variable(s).&lt;/P&gt;
&lt;PRE&gt;Proc format;
value Mydate
low-high=[yymmddd10.]
. = "Missing"
;

data example;
   do date=., '01Jan2020'd to '05Jan2020'd;
      output;
   end;
   format date yymmddd10.;
run;

ods excel file="&amp;lt;path&amp;gt;\excelexample.xlsx";

proc print data=example;
   var date;
   format date mydate.;
run;
ods excel close;&lt;/PRE&gt;
&lt;P&gt;The Proc format code creates a custom date format I have named mydate. The Low-High&amp;nbsp; indicates the range of values to display when not missing and the [yymmddd10.]&amp;nbsp; says to use the dash version of the date in yyyy-mm-dd format.The . says to display any missing values as the text in quotes.&lt;/P&gt;
&lt;P&gt;The data step is just to create a small data set of values with one missing.&lt;/P&gt;
&lt;P&gt;Then the Ods Excel to Ods excel close prints the data set to an XLSX file. If you run this code it is up to you to provide a path that is valid on your system.&lt;/P&gt;
&lt;P&gt;This will have the actual dates as date values that Excel can use as normal and character value for the missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: the SAS date formats do not display any year past 9999 even though you can have values much later than that. The year portion will display as ****.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 04:04:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689853#M209750</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-10-08T04:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689854#M209751</link>
      <description>&lt;P&gt;Yes, this if statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	IF	missing(c5) then 
		c5_char ='"Missing"';
	else
		c5_char = put(c5, yymmdd10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Will produce the output you requested.&amp;nbsp; I just ran it now.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1602132885849.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50349i727BC46EE850875B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1602132885849.png" alt="jimbarbour_0-1602132885849.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 04:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689854#M209751</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-08T04:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689879#M209764</link>
      <description>&lt;P&gt;Use a custom format, as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;suggested.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 06:16:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689879#M209764</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-08T06:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689956#M209807</link>
      <description>&lt;P&gt;I tried it but it still says invalid numeric data for some reason. this is the column attributes in my dataset. row 8, 9 have missing values ".". where as row 10 has the date in ddmmyy10. I&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_0-1602162151711.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50352i56B0487526F5E24F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASuserlot_0-1602162151711.png" alt="SASuserlot_0-1602162151711.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;want to replace"." with "Missing"&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 13:02:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689956#M209807</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T13:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689958#M209808</link>
      <description>&lt;P&gt;Please post the complete log of the step you ran.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 13:08:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689958#M209808</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-08T13:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689964#M209810</link>
      <description>&lt;PRE&gt;454
2455  c5=input(strtd ,32.)+ '30dec1899'd;/* excel has the character so the date converted to charcter
2455! "days"*/
2456  format c5 yymmdd10.;                                        /*changing back to numeric and date
2456! 11*/
2457
2458  if missing(c5) then c5="[Missing]";
2459  else c5=put(c5,mmddyyd10.);
2460
2461  run;

NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
      2458:24   2459:9
NOTE: Variable C6 is uninitialized.
NOTE: Variable C7 is uninitialized.
NOTE: Invalid numeric data, '09-27-2012' , at line 2459 column 9.&lt;/PRE&gt;&lt;P&gt;please ignore c6, c7&amp;nbsp; notes, I&amp;nbsp; looking for c5 which has the date&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 13:24:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689964#M209810</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T13:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689983#M209820</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350312"&gt;@SASuserlot&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You cannot do this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1602164539713.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50357i963FB9E1D1690CED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1602164539713.png" alt="jimbarbour_0-1602164539713.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;in SAS.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;c5 is numeric.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;You cannot set c5 to "[Missing]".&amp;nbsp;&amp;nbsp;"[Missing]" is character and is not numeric.&amp;nbsp; You cannot put a non-numeric value into a numeric variable.&lt;/LI&gt;
&lt;LI&gt;The result of put(c5, mmddyyd10.) is character.&amp;nbsp;&amp;nbsp;You cannot put a non-numeric value into a numeric variable.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;You cannot do this in SAS.&amp;nbsp; This will never work in 10,000,000 years.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;You &lt;EM&gt;must&lt;/EM&gt; use two variables&lt;/STRONG&gt;&lt;/FONT&gt;.&amp;nbsp; One variable should be numeric.&amp;nbsp; The other variable should be character.&amp;nbsp; If c5 is to be your final output and c5 needs to contain character values, then&amp;nbsp;&lt;STRONG&gt;c5 must be a &lt;EM&gt;character&lt;/EM&gt; variable.&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You must therefore NOT use c5 to hold the numeric date values that you have.&amp;nbsp; You have to use some other variable.&amp;nbsp; c5_temp might be a good name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have:&lt;/P&gt;
&lt;P&gt;c5_temp (a numeric variable)&lt;/P&gt;
&lt;P&gt;c5 (a character variable)&lt;/P&gt;
&lt;P&gt;then you can do what you are trying to do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code would then look like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If MISSING(C5_&lt;STRONG&gt;Temp&lt;/STRONG&gt;) then 
    c5 = "[Missing]";
else
    c5 = put(c5_&lt;STRONG&gt;temp&lt;/STRONG&gt;, mmddyyd10.);
    &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 13:56:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689983#M209820</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-08T13:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689985#M209821</link>
      <description>&lt;P&gt;Yes , I totally agree with it, but can i create excel column where it contains&amp;nbsp; dates and if date missing put a note of "missing" is it possible at all? because the problem here is they both have to display in the same column so I believe they have to be in same variable in dataset!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 13:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689985#M209821</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T13:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689994#M209824</link>
      <description>&lt;P&gt;First, try running the code.&amp;nbsp; What do you get in Excel?&amp;nbsp; Excel should be able to interpret something like 2019-09-12 as a date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1602165872387.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50360i7A92A71BF3F4DA0C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1602165872387.png" alt="jimbarbour_0-1602165872387.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 14:05:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689994#M209824</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-08T14:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689997#M209825</link>
      <description>&lt;P&gt;I ran excel giving the date as you mentioned. But where ever the date missing it display ".". this is where I want "Missing" word.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 14:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/689997#M209825</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T14:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/690006#M209829</link>
      <description>&lt;P&gt;Show me your code.&amp;nbsp; I think you're still using a numeric variable for column 5.&amp;nbsp; &lt;STRONG&gt;YOU CANNOT USE A NUMERIC VARIABLE&lt;/STRONG&gt; to represent c5.&amp;nbsp; c5 must be character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me show you some code.&amp;nbsp; Please notice that c5 is&amp;nbsp;&lt;STRONG&gt;character&lt;/STRONG&gt;.&amp;nbsp; C5 must be defined as character for it to contain "Missing" as a value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA	Date_Data;
	INPUT	c5_Temp	:	ANYDTDTE10.;

DATALINES;
2019-09-12
2019-09-13
2019-09-14
2019-09-15
2019-09-16
.
.
2019-09-19
;
RUN;

DATA	Excel_Data;
	LENGTH	C5	$10;
	DROP	C5_Temp;
	SET	Date_Data;

	IF	missing(c5_Temp) then 
		c5 ='"Missing"';
	else
		c5 = put(c5_temp, yymmdd10.);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here are my results in Excel:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1602166814891.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50362iEF6C93FE5A375A62/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1602166814891.png" alt="jimbarbour_0-1602166814891.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Please notice that c5 contains the values "Missing" just as you requested in 6th and 7th rows.&lt;/P&gt;
&lt;P&gt;Please notice also that if I add +1 to the value in the first column, I get a number.&amp;nbsp; A number means that Excel is interpreting the value in C5 as a date.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, look at the third column.&amp;nbsp; The third column is identical to the second column, but I have formatted the value in Excel.&amp;nbsp; Notice that the value is one day (+1) greater than the date in the first column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Everything is working just as you want, but:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;You must use&amp;nbsp;&lt;STRONG&gt;two&amp;nbsp;&lt;/STRONG&gt;variables.&amp;nbsp; One must be numeric.&amp;nbsp; The other must be character.&lt;/LI&gt;
&lt;LI&gt;The variable c5 must be a &lt;STRONG&gt;character&lt;/STRONG&gt; variable.&amp;nbsp; If you want c5 to hold values like "Missing", then c5 must be&amp;nbsp;&lt;STRONG&gt;character.&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 14:25:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/690006#M209829</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-08T14:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/690011#M209832</link>
      <description>I really appreciate your effort to clarify this to me. I will try with your suggestion, and will let you know. really Thanks you</description>
      <pubDate>Thu, 08 Oct 2020 14:30:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/690011#M209832</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T14:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/690015#M209835</link>
      <description>&lt;PRE&gt;Question for you, how to do if the  dataset have the date variable in the following format ( numeric), because you date_data set in the anydtdte10. format but in my data already its in yymmdd10.&lt;BR /&gt;&lt;BR /&gt;2019-09-12
2019-09-13
2019-09-14
2019-09-15
2019-09-16
.
.
2019-09-19&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Oct 2020 14:43:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/690015#M209835</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T14:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/690020#M209837</link>
      <description>&lt;P&gt;ANDTDTE10. is not a FORMAT.&amp;nbsp; It is an&amp;nbsp;&lt;STRONG&gt;IN&lt;/STRONG&gt;FORMAT.&amp;nbsp; SAS uses the informat to read the data.&amp;nbsp; The data is&amp;nbsp;&lt;EM&gt;stored&lt;/EM&gt; as numeric.&amp;nbsp; &lt;STRONG&gt;My data is identical to your data&lt;/STRONG&gt; once it is inside SAS.&amp;nbsp; My data is numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my data:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1602168419812.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50365iA5B26EEB8F0B52A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1602168419812.png" alt="jimbarbour_0-1602168419812.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, in other words, the code that I gave you works with &lt;STRONG&gt;numeric&lt;/STRONG&gt; data.&amp;nbsp; Notice also that the 6th and 7th values are a period (.) -- just like in your data.&amp;nbsp; A period represents a missing &lt;STRONG&gt;numeric&lt;/STRONG&gt; value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 14:50:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/690020#M209837</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-08T14:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert date 2020-10-12( numeric) to 2020-10-12( character)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/690036#M209843</link>
      <description>&lt;LI-SPOILER&gt;Thanks, I ran your code, I am happy with that. l will try to achieve what yo achieved. thanks&lt;/LI-SPOILER&gt;</description>
      <pubDate>Thu, 08 Oct 2020 15:09:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-date-2020-10-12-numeric-to-2020-10-12-character/m-p/690036#M209843</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T15:09:43Z</dc:date>
    </item>
  </channel>
</rss>

