<?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: replace a SAS date for one record in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/replace-a-SAS-date-for-one-record/m-p/717689#M221978</link>
    <description>Hi Reeza,&lt;BR /&gt;&lt;BR /&gt;Thank you so much for your prompt and useful response!&lt;BR /&gt;This is great!</description>
    <pubDate>Mon, 08 Feb 2021 18:27:38 GMT</pubDate>
    <dc:creator>Orchidn</dc:creator>
    <dc:date>2021-02-08T18:27:38Z</dc:date>
    <item>
      <title>replace a SAS date for one record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/replace-a-SAS-date-for-one-record/m-p/717685#M221976</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a record which has a missing value for a datetime20. field called &lt;STRONG&gt;ReportingDate&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to replace the missing value with a constant - like this '23Jan2021'd.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I assign this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if ReportingDate=. then ReportingDate= '23Jan2021'd &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I obtain this value:&lt;STRONG&gt; 01JAN1960:06:11:43&amp;nbsp;&lt;/STRONG&gt;instead of the&amp;nbsp;&lt;STRONG&gt;23Jan2021&lt;/STRONG&gt; value that I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I solve this issue?&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 18:17:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/replace-a-SAS-date-for-one-record/m-p/717685#M221976</guid>
      <dc:creator>Orchidn</dc:creator>
      <dc:date>2021-02-08T18:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: replace a SAS date for one record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/replace-a-SAS-date-for-one-record/m-p/717688#M221977</link>
      <description>&lt;P&gt;You've provided a date, not a DATETIME value.&lt;BR /&gt;You can use the DHMS function and pass the date in as the number of days to get a DateTime variable, or you can provide it as a datetime literal.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if ReportingDate=. then ReportingDate= dhms('23Jan2021'd, 0, 0, 0);

if ReportingDate=. then ReportingDate= '23Jan2021:00:00:00'dt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here's a great, but longer and in depth, reference for dates and times in SAS&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265464"&gt;@Orchidn&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a record which has a missing value for a datetime20. field called &lt;STRONG&gt;ReportingDate&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to replace the missing value with a constant - like this '23Jan2021'd.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I assign this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;if ReportingDate=. then ReportingDate= '23Jan2021'd &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I obtain this value:&lt;STRONG&gt; 01JAN1960:06:11:43&amp;nbsp;&lt;/STRONG&gt;instead of the&amp;nbsp;&lt;STRONG&gt;23Jan2021&lt;/STRONG&gt; value that I want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I solve this issue?&lt;/P&gt;
&lt;P&gt;Thank you so much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 18:23:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/replace-a-SAS-date-for-one-record/m-p/717688#M221977</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-02-08T18:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: replace a SAS date for one record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/replace-a-SAS-date-for-one-record/m-p/717689#M221978</link>
      <description>Hi Reeza,&lt;BR /&gt;&lt;BR /&gt;Thank you so much for your prompt and useful response!&lt;BR /&gt;This is great!</description>
      <pubDate>Mon, 08 Feb 2021 18:27:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/replace-a-SAS-date-for-one-record/m-p/717689#M221978</guid>
      <dc:creator>Orchidn</dc:creator>
      <dc:date>2021-02-08T18:27:38Z</dc:date>
    </item>
  </channel>
</rss>

