<?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: SAS programming in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-programming/m-p/689328#M209537</link>
    <description>&lt;P&gt;Here's some code.&amp;nbsp; I'm copying the values verbatim from your original post.&amp;nbsp; Look at the results below that.&amp;nbsp; Notice that Med_Order_DateTime is just that, a date-time value.&amp;nbsp; I didn't change the value.&amp;nbsp; I just formatted it.&amp;nbsp; DateTime values are &lt;EM&gt;&lt;STRONG&gt;stored&lt;/STRONG&gt;&amp;nbsp;&lt;/EM&gt;as a count of seconds since January 1, 1960.&amp;nbsp; You can&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;format&lt;/EM&gt;&lt;/STRONG&gt; them any way you like.&amp;nbsp; The format is used to display them so the human eye can read them, but the internal value is a number representing the number of seconds.&amp;nbsp; Format them as you please, but the underlying value will not change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dates and times are similar.&amp;nbsp; Notice they icons SAS uses.&amp;nbsp; MedGiven_Sec has a little clock, for example, indicating that SAS will handle this as a time value.&amp;nbsp; I've formatted them with date and time formats, respectively, but they are both&amp;nbsp;&lt;EM&gt;stored&lt;/EM&gt; as numbers.&amp;nbsp; Date values, for example, are a count of the number of days since January 1, 1960.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA	Dates_And_Times;
	Format	Med_order_datetime	DATETIME21.2;
	Format	MedGiven			DATE9.;
	Format	MedGiven_Sec		TIME8.;

	Med_order_datetime		=	1758828180;
	MedGiven				=	20356;
	medgiven_sec			=	20356.807639;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1602013291503.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50236iDBF14691CABF36EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1602013291503.png" alt="jimbarbour_0-1602013291503.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>Tue, 06 Oct 2020 19:46:19 GMT</pubDate>
    <dc:creator>jimbarbour</dc:creator>
    <dc:date>2020-10-06T19:46:19Z</dc:date>
    <item>
      <title>SAS programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-programming/m-p/689321#M209534</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;Please, I need help with date and time format. I have a variable labelled "Med_order_datetime" with observations that looks like this&amp;nbsp;&amp;nbsp;"1758828180".&lt;/P&gt;
&lt;P&gt;I also have another variable labelled "medgiven"&amp;nbsp; which has observations like "20356" and a "medgiven_sec" variable with observations that look like this "20356.807639".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please, I need help converting them to date and time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 19:28:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-programming/m-p/689321#M209534</guid>
      <dc:creator>UcheOkoro</dc:creator>
      <dc:date>2020-10-06T19:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: SAS programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-programming/m-p/689322#M209535</link>
      <description>&lt;P&gt;Actually, if those values are in a SAS data set, they already look like dates and times.&amp;nbsp; All you need to do is format them for the human eye.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Give me a moment and let me create an example...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 19:31:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-programming/m-p/689322#M209535</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-06T19:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-programming/m-p/689328#M209537</link>
      <description>&lt;P&gt;Here's some code.&amp;nbsp; I'm copying the values verbatim from your original post.&amp;nbsp; Look at the results below that.&amp;nbsp; Notice that Med_Order_DateTime is just that, a date-time value.&amp;nbsp; I didn't change the value.&amp;nbsp; I just formatted it.&amp;nbsp; DateTime values are &lt;EM&gt;&lt;STRONG&gt;stored&lt;/STRONG&gt;&amp;nbsp;&lt;/EM&gt;as a count of seconds since January 1, 1960.&amp;nbsp; You can&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;format&lt;/EM&gt;&lt;/STRONG&gt; them any way you like.&amp;nbsp; The format is used to display them so the human eye can read them, but the internal value is a number representing the number of seconds.&amp;nbsp; Format them as you please, but the underlying value will not change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dates and times are similar.&amp;nbsp; Notice they icons SAS uses.&amp;nbsp; MedGiven_Sec has a little clock, for example, indicating that SAS will handle this as a time value.&amp;nbsp; I've formatted them with date and time formats, respectively, but they are both&amp;nbsp;&lt;EM&gt;stored&lt;/EM&gt; as numbers.&amp;nbsp; Date values, for example, are a count of the number of days since January 1, 1960.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA	Dates_And_Times;
	Format	Med_order_datetime	DATETIME21.2;
	Format	MedGiven			DATE9.;
	Format	MedGiven_Sec		TIME8.;

	Med_order_datetime		=	1758828180;
	MedGiven				=	20356;
	medgiven_sec			=	20356.807639;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1602013291503.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50236iDBF14691CABF36EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1602013291503.png" alt="jimbarbour_0-1602013291503.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>Tue, 06 Oct 2020 19:46:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-programming/m-p/689328#M209537</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-06T19:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-programming/m-p/689331#M209539</link>
      <description>&lt;P&gt;Thank you so much, Jimbarbour. I am grateful.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 20:11:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-programming/m-p/689331#M209539</guid>
      <dc:creator>UcheOkoro</dc:creator>
      <dc:date>2020-10-06T20:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-programming/m-p/689346#M209543</link>
      <description>&lt;P&gt;That&amp;nbsp;&lt;SPAN&gt;20356.807639 could be the result of an import of a Excel datetime, where '30dec1899'd was added, but the Excel time (fraction of a day) was not converted.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 21:23:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-programming/m-p/689346#M209543</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-06T21:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-programming/m-p/689364#M209553</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/319831"&gt;@UcheOkoro&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're very welcome.&amp;nbsp; Be a little careful with&amp;nbsp;medgiven_sec.&amp;nbsp; It bothers me that it's different than the other values.&amp;nbsp; Is there a way to validate that it is correctly rendered?&amp;nbsp; Can we double check to see if it is giving us the correct time?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 22:48:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-programming/m-p/689364#M209553</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-06T22:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-programming/m-p/689583#M209651</link>
      <description>I will verify to see which is the correct time.  Thank you.&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Oct 2020 15:17:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-programming/m-p/689583#M209651</guid>
      <dc:creator>UcheOkoro</dc:creator>
      <dc:date>2020-10-07T15:17:13Z</dc:date>
    </item>
  </channel>
</rss>

