<?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: datetime16. to downame in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/datetime16-to-downame/m-p/699041#M213839</link>
    <description>&lt;P&gt;It is always a good thing to provide data in usable form (a data step with datalines), so we have a clear picture what you're talking about.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=leforinforref&amp;amp;docsetTarget=p16z3pt9h9fdn6n1sxv7lzei34gp.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;DOWNAME&lt;/A&gt;&amp;nbsp;expects a date value as argument. In SAS, dates and datetimes work on a different scale (count of days vs. count of seconds), so if you do have a SAS datetime, you need to extract the date with&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0rttbu7w62xgzn1damccyuwpld8.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;DATEPART&lt;/A&gt;&amp;nbsp;first:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newvar = put(datepart(oldvar),downame.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 16 Nov 2020 05:35:15 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-11-16T05:35:15Z</dc:date>
    <item>
      <title>datetime16. to downame</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime16-to-downame/m-p/699033#M213833</link>
      <description>&lt;P&gt;Hi, I need to create a new variable by extracting the day of the week (sunday to saturday) out of a datetime16. (DDMMMYY:00:00:00). Can somebody help me out?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 05:03:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime16-to-downame/m-p/699033#M213833</guid>
      <dc:creator>swimmy</dc:creator>
      <dc:date>2020-11-16T05:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: datetime16. to downame</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime16-to-downame/m-p/699039#M213837</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
Date1 = '17mar85'd;
Word_day = put(Date1,DOWNAME.);
format Date1 datetime16.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I hope this will help you to get the expected result.&lt;/P&gt;
&lt;PRE&gt;data want;
set have;
Word_day = put(Date_Column,DOWNAME.);
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Nov 2020 05:35:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime16-to-downame/m-p/699039#M213837</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2020-11-16T05:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: datetime16. to downame</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime16-to-downame/m-p/699041#M213839</link>
      <description>&lt;P&gt;It is always a good thing to provide data in usable form (a data step with datalines), so we have a clear picture what you're talking about.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=leforinforref&amp;amp;docsetTarget=p16z3pt9h9fdn6n1sxv7lzei34gp.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;DOWNAME&lt;/A&gt;&amp;nbsp;expects a date value as argument. In SAS, dates and datetimes work on a different scale (count of days vs. count of seconds), so if you do have a SAS datetime, you need to extract the date with&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0rttbu7w62xgzn1damccyuwpld8.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;DATEPART&lt;/A&gt;&amp;nbsp;first:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newvar = put(datepart(oldvar),downame.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Nov 2020 05:35:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime16-to-downame/m-p/699041#M213839</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-16T05:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: datetime16. to downame</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime16-to-downame/m-p/699184#M213874</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2020-11-16 100728.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51719iBFF1FFEFAEFD2F53/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2020-11-16 100728.jpg" alt="Screenshot 2020-11-16 100728.jpg" /&gt;&lt;/span&gt;this is what I did (3rd row) and in the results, there is only *****. I don't know what is wrong.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 15:10:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime16-to-downame/m-p/699184#M213874</guid>
      <dc:creator>swimmy</dc:creator>
      <dc:date>2020-11-16T15:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: datetime16. to downame</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime16-to-downame/m-p/699186#M213875</link>
      <description>&lt;P&gt;Depending on how you are examining the data you have likely issues.&lt;/P&gt;
&lt;P&gt;If the display width of a column in a table viewer is not wide enough then SAS will typically display *** until the column is made wide enough.&lt;/P&gt;
&lt;P&gt;A second, and related issue, is that the "date" is treated as having a year past 9999 and none of the SAS display formats work with dates that far in the future.&lt;/P&gt;
&lt;P&gt;A third possibility is if the variable JOUR already exists in your data then the format assigned to the JOUR variable does not like the value of putting the datepart.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 15:24:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime16-to-downame/m-p/699186#M213875</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-16T15:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: datetime16. to downame</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime16-to-downame/m-p/699199#M213878</link>
      <description>&lt;P&gt;I see no start_date in that screenshot.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please post data in usable form&lt;/STRONG&gt; (I will NOT repeat that request for a third time),&lt;/P&gt;
&lt;P&gt;and post the&amp;nbsp;&lt;EM&gt;complete log&lt;/EM&gt; of your data step by copy/pasting it into a window opened with the &amp;lt;/&amp;gt; button. Do not, I repeat NOT, post logs or code in pictures.&lt;/P&gt;
&lt;P&gt;Use the "little running man" button right next to the &amp;lt;/&amp;gt; for code.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 16:10:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime16-to-downame/m-p/699199#M213878</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-16T16:10:21Z</dc:date>
    </item>
  </channel>
</rss>

