<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Dates/m-p/875452#M345896</link>
    <description>&lt;P&gt;The origin of the confusion is that the EG, when you hoover over variable name in open dataset, if it recognise numeric variable with date/datetime fomat it displays "date" type.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="EG_date.jpg" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83918iB89BEA665A8E216C/image-size/small?v=v2&amp;amp;px=200" role="button" title="EG_date.jpg" alt="EG_date.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 May 2023 13:11:47 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2023-05-12T13:11:47Z</dc:date>
    <item>
      <title>Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dates/m-p/875421#M345883</link>
      <description>Can anyone please help me in how to convert the date 03/01/2022 to 01MAR2022:00:00:00</description>
      <pubDate>Fri, 12 May 2023 11:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dates/m-p/875421#M345883</guid>
      <dc:creator>Akshaya_1397</dc:creator>
      <dc:date>2023-05-12T11:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dates/m-p/875425#M345886</link>
      <description>&lt;P&gt;More information is needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is&amp;nbsp;&lt;SPAN&gt;03/01/2022 in a character variable in a data set? Is it in a numeric variable in a data set? If numeric, what is the format? Is it found in a text file that&amp;nbsp;you have to read into SAS? Is it something else?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 11:53:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dates/m-p/875425#M345886</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-12T11:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dates/m-p/875438#M345890</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/425756"&gt;@Akshaya_1397&lt;/a&gt;&amp;nbsp;Take a look at&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/basess/p0er6damfbjifwn1ih1b1tacw5zj.htm" target="_self"&gt;Working with Dates in the SAS System&lt;/A&gt;&amp;nbsp;that's a good starting place&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lepg/n0mnbmcjgwpiotn116oz5wtifwxa.htm" target="_self"&gt;Dates, Times, and Intervals&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Here's some examples of using SAS Date/Time values&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.have ;
	date="15APR2023"d ; /* SAS Date Constant */
	put date= date= ddmmyy10. ; /* Output to the SAS log the raw date value and a formated date value */
	datetime="15APR2023 11:59:59"dt ; /* SAS Date Time Constant */
	put datetime= datetime= datetime. ;/* Output to the SAS log the raw datetime value and a formated datetime value */
	cdate=putn(date,"mmddyy8.") ; /* Convert a SAS date value into a character variable using a format (mmddyy8.) */
	put cdate= ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 May 2023 12:06:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dates/m-p/875438#M345890</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2023-05-12T12:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dates/m-p/875439#M345891</link>
      <description>&lt;P&gt;I have two seprate dates in which&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataset A has the variable due_date = 03/01/2022- type-date length-8&lt;/P&gt;&lt;P&gt;Dataset B has the variable due_date = 01MAR2022:00:00:00- TYPE DATE&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I need to change the dates to same format.&lt;/P&gt;&lt;P&gt;Either A-B or B -A&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 11:55:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dates/m-p/875439#M345891</guid>
      <dc:creator>Akshaya_1397</dc:creator>
      <dc:date>2023-05-12T11:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dates/m-p/875440#M345892</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/425756"&gt;@Akshaya_1397&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have two seprate dates in which&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dataset A has the variable due_date = 03/01/2022- type-date length-8&lt;/P&gt;
&lt;P&gt;Dataset B has the variable due_date = 01MAR2022:00:00:00- TYPE DATE&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I need to change the dates to same format.&lt;/P&gt;
&lt;P&gt;Either A-B or B -A&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In SAS, there is no such thing as type-date, so I don't know what you mean. Nevertheless, you have not answered my questions, so I ask again:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;03/01/2022 in a character variable in a data set? Is it in a numeric variable in a data set? If numeric, what is the format? Is it found in a text file that&amp;nbsp;you have to read into SAS? (okay, this last one is answered, these are in SAS data sets)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 11:58:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dates/m-p/875440#M345892</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-12T11:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dates/m-p/875452#M345896</link>
      <description>&lt;P&gt;The origin of the confusion is that the EG, when you hoover over variable name in open dataset, if it recognise numeric variable with date/datetime fomat it displays "date" type.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="EG_date.jpg" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83918iB89BEA665A8E216C/image-size/small?v=v2&amp;amp;px=200" role="button" title="EG_date.jpg" alt="EG_date.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 13:11:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dates/m-p/875452#M345896</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-05-12T13:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dates/m-p/875457#M345900</link>
      <description>&lt;P&gt;Ok, with the explanation for&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;you do the conversion in data set A like this&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;due_date=dhms(due_date,0,0,0);
format due_date datetime19.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 13:19:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dates/m-p/875457#M345900</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-12T13:19:54Z</dc:date>
    </item>
  </channel>
</rss>

