<?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: Dates display as ****** after format transformation. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Dates-display-as-after-format-transformation/m-p/472777#M285826</link>
    <description>&lt;P&gt;Alternatively, you may want to extract the dates from your datetime values by means of the &lt;A href="http://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p0rttbu7w62xgzn1damccyuwpld8.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;DATEPART function&lt;/A&gt;&amp;nbsp;and then assign the date format of your choice to the resulting SAS date values:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
date=datepart(time);
format date yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Background:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Variables with date, time or datetime formats are &lt;EM&gt;ordinary numeric variables&lt;/EM&gt;, i.e., they contain &lt;EM&gt;numbers&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What kind of numbers?&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;numbers of days after 1 January 1960 in the case of date values (e.g.&amp;nbsp;14335 for 1 April 1999)&lt;/LI&gt;
&lt;LI&gt;numbers of seconds after midnight (00:00) in the case of time values (e.g. 41400 for 11:30 AM)&lt;/LI&gt;
&lt;LI&gt;numbers of seconds after 1 January 1960, 00:00 in the case of datetime values (e.g. 1238585400 for 1 April 1999, 11:30 AM).&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Date, time and datetime formats &lt;EM&gt;interpret&lt;/EM&gt; these numbers accordingly in order to display the values in a human readable form.&lt;/P&gt;
&lt;P&gt;So, when you (inappropriately) apply the &lt;U&gt;date&lt;/U&gt; format YYMMDD10. to your &lt;U&gt;datetime&lt;/U&gt; variable TIME, SAS tries to interpret values like &lt;SPAN&gt;1238585400&lt;/SPAN&gt; (a number of &lt;EM&gt;seconds&lt;/EM&gt; after 1 Jan 1960, 00:00) as a number of &lt;EM&gt;days&lt;/EM&gt; after 1 Jan 1960. The result, a date about 3 million years (!) from now, exceeds the range of admissible SAS date values and is therefore displayed as ********** by format YYMMDD10.&lt;/P&gt;</description>
    <pubDate>Sun, 24 Jun 2018 12:05:54 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2018-06-24T12:05:54Z</dc:date>
    <item>
      <title>Dates display as ****** after format transformation.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dates-display-as-after-format-transformation/m-p/472773#M285824</link>
      <description>&lt;P&gt;I have a variable whose format is DATETIME. . But after&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format time yymmdd10.&amp;nbsp;;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The values of variable become ******. I have tried &lt;STRONG&gt;quarter=input(time, yyddmm10.)&lt;/STRONG&gt; and &lt;STRONG&gt;quarter=put(time,yymmdd10.)&lt;/STRONG&gt;. But they all become *****.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Before:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-06-24_18-36-36.jpg" style="width: 330px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21354iD10EACFC686AD823/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-06-24_18-36-36.jpg" alt="2018-06-24_18-36-36.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-06-24_18-37-08.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21355i81261C897805F96C/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-06-24_18-37-08.jpg" alt="2018-06-24_18-37-08.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;After&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-06-24_18-37-48.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21356iA7BDFFEB62237FE8/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-06-24_18-37-48.jpg" alt="2018-06-24_18-37-48.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jun 2018 10:44:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dates-display-as-after-format-transformation/m-p/472773#M285824</guid>
      <dc:creator>Kilasuelika</dc:creator>
      <dc:date>2018-06-24T10:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Dates display as ****** after format transformation.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dates-display-as-after-format-transformation/m-p/472776#M285825</link>
      <description>&lt;P&gt;Your data in variable TIME is a date-time value, not a date value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore, you have to use a date-time format, not a date format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format time datetime7.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jun 2018 13:07:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dates-display-as-after-format-transformation/m-p/472776#M285825</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-24T13:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dates display as ****** after format transformation.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dates-display-as-after-format-transformation/m-p/472777#M285826</link>
      <description>&lt;P&gt;Alternatively, you may want to extract the dates from your datetime values by means of the &lt;A href="http://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p0rttbu7w62xgzn1damccyuwpld8.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;DATEPART function&lt;/A&gt;&amp;nbsp;and then assign the date format of your choice to the resulting SAS date values:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
date=datepart(time);
format date yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Background:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Variables with date, time or datetime formats are &lt;EM&gt;ordinary numeric variables&lt;/EM&gt;, i.e., they contain &lt;EM&gt;numbers&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What kind of numbers?&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;numbers of days after 1 January 1960 in the case of date values (e.g.&amp;nbsp;14335 for 1 April 1999)&lt;/LI&gt;
&lt;LI&gt;numbers of seconds after midnight (00:00) in the case of time values (e.g. 41400 for 11:30 AM)&lt;/LI&gt;
&lt;LI&gt;numbers of seconds after 1 January 1960, 00:00 in the case of datetime values (e.g. 1238585400 for 1 April 1999, 11:30 AM).&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Date, time and datetime formats &lt;EM&gt;interpret&lt;/EM&gt; these numbers accordingly in order to display the values in a human readable form.&lt;/P&gt;
&lt;P&gt;So, when you (inappropriately) apply the &lt;U&gt;date&lt;/U&gt; format YYMMDD10. to your &lt;U&gt;datetime&lt;/U&gt; variable TIME, SAS tries to interpret values like &lt;SPAN&gt;1238585400&lt;/SPAN&gt; (a number of &lt;EM&gt;seconds&lt;/EM&gt; after 1 Jan 1960, 00:00) as a number of &lt;EM&gt;days&lt;/EM&gt; after 1 Jan 1960. The result, a date about 3 million years (!) from now, exceeds the range of admissible SAS date values and is therefore displayed as ********** by format YYMMDD10.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jun 2018 12:05:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dates-display-as-after-format-transformation/m-p/472777#M285826</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-06-24T12:05:54Z</dc:date>
    </item>
  </channel>
</rss>

