<?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: Date from SAS showing 1/1/1960 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84755#M24255</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;larry, Fleero&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The frustration about something at first looking that simple as date/time is quite understable.&lt;/P&gt;&lt;P&gt;Having been involved (set up testing facilties) with milo-testing time/date shifts the incredible complexity of dates became fully visable.&lt;BR /&gt;And even that you have not seen a glimse of discrepandancies of date/time indications used in the world. It is part of NLS support (National Language) and all SAS/Access parts (including Excel).&amp;nbsp; Just recently some standards have been set: ISO8601 an those are not widley published/known. &lt;BR /&gt;You will be able to find references to those at SAS documentation when needed now.&amp;nbsp;&amp;nbsp; But they are not SAS specific, in contrary it is usable everywhere.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jul 2013 17:36:28 GMT</pubDate>
    <dc:creator>jakarman</dc:creator>
    <dc:date>2013-07-22T17:36:28Z</dc:date>
    <item>
      <title>Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84738#M24238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm a SAS user for 1 week now, so complete rookie.&amp;nbsp;&amp;nbsp; I am calling a SAS program from a Shell Script (Unix .ksh)&amp;nbsp; and within the SAS program I am retrieving the Current Date from the shell as such:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET curdate=%SYSGET(CURDATE);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the program, I am parsing out records from a .LST file as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATA safety_hrs;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INFILE getin missover firstobs=4;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2&amp;nbsp;&amp;nbsp; STATION&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @12&amp;nbsp; CONTR_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $8.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @27&amp;nbsp; CONTR_NAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $35.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @81&amp;nbsp; PRIM_SVC_AREA_ID $6.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @91&amp;nbsp; DRIVER_NBR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $7.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @102 DRIVER_NAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $35. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @145 PD_HRS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @161 SP_HRS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @177 L_HRS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then set the Date I got from the Shell to a variable like so:&lt;/P&gt;&lt;P&gt;HOS_DATE=&amp;amp;curdate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An Finally the select into my Oracle table as follows:&lt;/P&gt;&lt;P&gt;proc sql; &lt;/P&gt;&lt;P&gt;insert into safety.safety_hrs_svc&lt;/P&gt;&lt;P&gt;select HOS_DATE, STATION, CONTR_ID, CONTR_NAME, PRIM_SVC_AREA_ID, DRIVER_NBR, DRIVER_NAME, PCK_DELV_HRS, SPOT_HRS, LINEHAUL_HRS from work.safety_hrs;&lt;/P&gt;&lt;P&gt;quit;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THE PROBLEM....&amp;nbsp; The date shows as 1/1/1960 in the Oracle Table, yet when I use a %Put&amp;nbsp; (%put &amp;amp;curdate;) to display it in the SAS log it indeed shows as the true date&amp;nbsp; 7/19/2013 as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable CURDATE resolves to 07/19/2013&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the problem ? Where am I going wrong ?&amp;nbsp;&amp;nbsp; Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2013 17:29:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84738#M24238</guid>
      <dc:creator>Fleroo</dc:creator>
      <dc:date>2013-07-19T17:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84739#M24239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;HOS_DATE=&amp;amp;curdate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;That's possibly it. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;In code that would resolve to &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;HOS_DATE=&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;07/19/2013;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Which is equal to 7 divided by 19 divided by 2013 which is pretty close to 0 and therefore January 1, 1960. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Anyways, you should be able to use the SAS date as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;%let&lt;/SPAN&gt; curdate=&lt;SPAN style="color: #0433ff;"&gt;%sysfunc&lt;/SPAN&gt;(date(), date9.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;%put&lt;/SPAN&gt; &amp;amp;curdate;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;Then&amp;nbsp; use&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;HOS_DATE="&amp;amp;curdate"d;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;You might be able to nest it like follows if you want the system date instead of using the SAS date() function:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;%LET&lt;/SPAN&gt; curdate=&lt;SPAN style="color: #0433ff;"&gt;%sysfunc&lt;/SPAN&gt;(&lt;SPAN style="color: #0433ff;"&gt;%SYSGET&lt;/SPAN&gt;(CURDATE), date9.);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2013 19:27:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84739#M24239</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-07-19T19:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84740#M24240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Hi Fleroo,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First some points about how both SAS and Oracle store dates.&amp;nbsp; Sas stores dates as numeric value representing the number of days since 1/1/1960.&amp;nbsp; I believe oracle also stores as numeric count with a different base date but I could be wrong.&amp;nbsp; Also Unix does the same but again with a different reference point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I think is happening:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Macro compiler: The statement &lt;STRONG&gt;HOS_DATE=&amp;amp;curdate; &lt;/STRONG&gt;is resolved to&lt;STRONG&gt; HOS_DATE = 07/19/2013 ;&lt;/STRONG&gt; by the macro compiler.&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; The data step compiler sees HOS_DATE = 07/19/2013 ; and assumes HOS_DATE is a numeric variable because it does not see a quoted literal.&amp;nbsp; It then performs the arithmetic operation of 7 DIVIDED BY 19 DIVIDED BY 2013.&amp;nbsp; This results in 0.0001931887.&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; When SAS is communicating to oracle, it takes its internal value and formats as a date string which Oracle can interpret.&amp;nbsp; Since SAS dates are stored as the number of days since 1/1/1960, a value of 0 ==&amp;gt; 1/1/1960, which is what is sent to Oracle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fix, change your assignment statement to either:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. &lt;STRONG&gt;HOS_DATE="&amp;amp;curdate"d;&amp;nbsp; &lt;/STRONG&gt; Note the double quotes are important to get the macro variable resolved and quoting a date-like string and appending the character d at the end tells SAS this is a date value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use built-in sas function and avoid system dependent commands:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;HOS_DATE = today() ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note ; if you want to check what the internal value of HOS_date is in your work data set run the following code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data _null_ ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set work.safety_hrs;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put hos_date= ;&amp;nbsp;&amp;nbsp;&amp;nbsp; * uses data set format of hos_date ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put hos_date= date9. ; * format as a date;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put hos_date=&amp;nbsp; 16.14 ;&amp;nbsp; * format as number not date ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some reading that might be helpful would be to look at the SAS 9.X Language Reference Concepts document for your release of SAS -- chapter 2 and 7 in particular.&amp;nbsp; Here is link for 9.2 pdf version,&lt;STRONG&gt; &lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/PDF/default/lrcon.pdf"&gt;http://support.sas.com/documentation/cdl/en/lrcon/62955/PDF/default/lrcon.pdf&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope this helps.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2013 19:33:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84740#M24240</guid>
      <dc:creator>LarryWorley</dc:creator>
      <dc:date>2013-07-19T19:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84741#M24241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the replies guys, but no go.&amp;nbsp; I substituted my code for this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; %let curdate=%sysfunc(date(), date9.);&lt;/P&gt;&lt;P&gt; %put &amp;amp;curdate;&lt;/P&gt;&lt;P&gt; HOS_DATE="&amp;amp;curdate"d;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I displayed the date in the Sas.log file.&amp;nbsp;&amp;nbsp; I got the following message:&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable CURDATE resolves to 19JUL2013&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, when sending HOS_DATE to Oracle on the Insert, the date still came out as 1/1/1960.&amp;nbsp; I'm completely puzzled at this.&amp;nbsp; Something appears to be converting it on the Select or Insert Statements ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2013 19:51:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84741#M24241</guid>
      <dc:creator>Fleroo</dc:creator>
      <dc:date>2013-07-19T19:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84742#M24242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Fleroo. Is your oracle data field a datetime field by chance? if so that's your problem (if you are doing a create table from sas to oracle it automates it as a datetime).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me clarify that I actually am going to assume it is, because in oracle the "date" field is actually a date time field (it stores the DD-MM-yy:HH:MM:SS). However when you query the results it only returns the date portion unless you tell it specifically not too (by the way, this is one of the many reasons some people HATE oracle).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways, what is happening is that when sas stores a date, it actually stores a number (the number of days between 1-1-1960 and whatever date you want to display). Aka if you wanted to display 1-5-1960, it would store a 5. The issue is when you insert this into the sql server, it converts the 5 DAYS into 5 SECONDS, and your date becomes 1-1-1960:00:00:05, but again oracle only displays 1-1-1960.....&lt;/P&gt;&lt;P&gt;So if you want to get your process to work, wrap you date into a datetime (do this by using the dmhs function, or dhms(YOURDATE,0,0,0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THen when you insert this into the database it will work! (if this was your problem of course!)&lt;/P&gt;&lt;P&gt;Sorry you're stuck with oracle&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2013 20:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84742#M24242</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-07-19T20:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84743#M24243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We still are not seeing how the value is being stored in your work data set.&amp;nbsp; Need to see the value of hos_date, in addition to currdate.&amp;nbsp; Try adding the following statements to the data step:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put hos_date= ;&amp;nbsp;&amp;nbsp;&amp;nbsp; * uses data set format of hos_date ;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put hos_date= date9. ; * format as a date;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put hos_date=&amp;nbsp; 16.14 ;&amp;nbsp; * format as number not date ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also please run a proc contents on your working data set and look at the format associated with hos_date.&amp;nbsp; If there is no format, you may need to add a date format so that SAS knows what to do when it writes the data it sends to oracle. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also run proc contents on the oracle table, Perhaps it has hos_date formatted as a string and not a date value.In which case, you would need to store currdate as a string in the work data set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2013 20:09:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84743#M24243</guid>
      <dc:creator>LarryWorley</dc:creator>
      <dc:date>2013-07-19T20:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84744#M24244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;BR /&gt;All information on how working with dates are correct.&lt;/P&gt;&lt;P&gt;- All kind of tools like SAS Excel Oracle MYSql are using different conventions.&lt;/P&gt;&lt;P&gt;- SAS is using a numeric format counting days (seconds).&lt;/P&gt;&lt;P&gt;&amp;nbsp; The literal conversion macro to SAS variabel is done by the '...'d&amp;nbsp;&amp;nbsp; (literlal representing date convention) all found in LRCON.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The more tricky parts:&lt;/P&gt;&lt;P&gt;- You need formats (output) and informats connected to the variable (format statement or attribute statement) by that all SAS processing will know it.&lt;BR /&gt;A common habit is explicitly coding formats while just using the put statement. However this bypasses metadata information in the SAS table-header. Use proc contents to list this kind of information in libraries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Translations (automatic):&lt;/P&gt;&lt;P&gt;When using a SAS/Access interface it will use the Oracle part (DML already existing tables, commonly a DBA has defined the table lay-out DDL)&lt;BR /&gt;and the SAS table header information to the necessary translate and convert.&amp;nbsp; See:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/65053/HTML/default/viewer.htm#p06jk0u30uhuj5n18fqw9sxr25lk.htm" title="http://support.sas.com/documentation/cdl/en/acreldb/65053/HTML/default/viewer.htm#p06jk0u30uhuj5n18fqw9sxr25lk.htm"&gt;SAS/ACCESS(R) 9.4 for Relational Databases: Reference&lt;/A&gt; chapter Data Types for Oracle"" &lt;BR /&gt;The Date type Oracle and SAS Datetime type (measurement Seconds) are equivalent&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Overruling an automatic conversion is also possible by using DBTYPE and SASDBTYPE as options.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/65053/HTML/default/viewer.htm#p1dqaq7ub1cm1pn1ow3x9qkmkxe8.htm" title="http://support.sas.com/documentation/cdl/en/acreldb/65053/HTML/default/viewer.htm#p1dqaq7ub1cm1pn1ow3x9qkmkxe8.htm"&gt;SAS/ACCESS(R) 9.4 for Relational Databases: Reference&lt;/A&gt; (DBTYPE)&lt;/P&gt;&lt;P&gt;..==..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jul 2013 20:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84744#M24244</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-07-21T20:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84745#M24245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Anotherdream, yes the date is stored in an Oracle table, and it is indeed a date/time field.&amp;nbsp; I tried this........ HOS_DATE= dhms(&amp;amp;curdate,0,0,0);&amp;nbsp; but the SAS log threw an error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 72-185: The DHMS function call has too many arguments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it appears the Syntax is incorrect .&amp;nbsp; All examples I see onlune are showing the date portion as a literal, for instance, &lt;/P&gt;&lt;P&gt;DHMS(&lt;STRONG&gt;'21JAN2011'd&lt;/STRONG&gt;,&lt;STRONG&gt;0&lt;/STRONG&gt;,&lt;STRONG&gt;0&lt;/STRONG&gt;,&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New; background: white; color: black; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what would be correct Syntax for my date names &amp;amp;curdate ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 14:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84745#M24245</guid>
      <dc:creator>Fleroo</dc:creator>
      <dc:date>2013-07-22T14:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84746#M24246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you try?&lt;/P&gt;&lt;P&gt;hos_date = dhms("&amp;amp;curdate"d,0,0,0):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dhms variables are either date variables or numeric or something that converts to such like a date literal. Your posted code does not have the date literal syntax around your macro variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 14:48:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84746#M24246</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-07-22T14:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84747#M24247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;esjacks, I just tried it and get the following error in the log:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable CURDATE resolves to 22JUL2013&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HERE IS MY COMPLETE CODE....... AS FOLLOWS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPTIONS LINESIZE = 255 PAGESIZE = 60 FULLSTIMER symbolgen macrogen;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;BR /&gt;* filename getin "/home/odeftpp/hos.txt";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;filename getin "/home/odeftpp/HOS_Safety_Combined_Hrs.lst";&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;* read in UNIX date (system date) variable CURDATE from a shell script and assign it as the macro variable curdate;&lt;BR /&gt; %let curdate=%sysfunc(date(), date9.);&lt;BR /&gt; %put &amp;amp;curdate;&lt;/P&gt;&lt;P&gt;hos_date = dhms("&amp;amp;curdate"d,0,0,0):&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DATA safety_hrs;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; INFILE getin missover firstobs=4;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; INPUT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2&amp;nbsp;&amp;nbsp; STATION&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @12&amp;nbsp; CONTR_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $8.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @27&amp;nbsp; CONTR_NAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $35.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @81&amp;nbsp; PRIM_SVC_AREA_ID $6.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @91&amp;nbsp; DRIVER_NBR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $7.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @102 DRIVER_NAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $35. &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @145 PCK_DELV_HRS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.2&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @161 SPOT_HRS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.2&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @177 LINEHAUL_HRS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if PCK_DELV_HRS = . then PCK_DELV_HRS = 0.00; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if SPOT_HRS = . then SPOT_HRS = 0.00;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if LINEHAUL_HRS = . then LINEHAUL_HRS = 0.00; &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc print data=safety_hrs (obs=25);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;libname safety oracle user=tmsapp password=tmsapp &lt;BR /&gt;&amp;nbsp;&amp;nbsp; path='dssdev02' schema=tmsown;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;proc sql; &lt;BR /&gt;insert into safety.safety_hrs_svc&lt;BR /&gt;select HOS_DATE, STATION, CONTR_ID, CONTR_NAME, PRIM_SVC_AREA_ID, DRIVER_NBR, DRIVER_NAME, PCK_DELV_HRS, SPOT_HRS, LINEHAUL_HRS from work.safety_hrs;&lt;BR /&gt;quit;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 14:55:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84747#M24247</guid>
      <dc:creator>Fleroo</dc:creator>
      <dc:date>2013-07-22T14:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84748#M24248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Granted, I'm a SAS rookie, but I can't believe how stinking hard it is to write the Current Date to an Oracle table from SAS.&amp;nbsp; Unreal.&amp;nbsp; :smileyplain:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 14:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84748#M24248</guid>
      <dc:creator>Fleroo</dc:creator>
      <dc:date>2013-07-22T14:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84749#M24249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're mixing open code and macro code, plus have a colon instead of semicolon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hos_date = dhms("&amp;amp;curdate"d,0,0,0): can't be written as is, unless its in a datastep. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't need it though, can put it straight into your proc sql statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql; &lt;/P&gt;&lt;P&gt;insert into safety.safety_hrs_svc&lt;/P&gt;&lt;P&gt;select dhms("&amp;amp;curdate"d,0,0,0) as hos_date, STATION, CONTR_ID, CONTR_NAME, PRIM_SVC_AREA_ID, DRIVER_NBR, DRIVER_NAME, PCK_DELV_HRS, SPOT_HRS, LINEHAUL_HRS from work.safety_hrs;&lt;/P&gt;&lt;P&gt;quit;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 15:15:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84749#M24249</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-07-22T15:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84750#M24250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Flerro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I find it hard to believe that you have not looked at the link to documentation i sent you.&amp;nbsp; Also perhaps you need to review macro processing also and spend a little time understanding the datastep process in SAS.&amp;nbsp; I show below how it might work in your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the DHMS function is a datastep function.&amp;nbsp; It needs to be within a data&amp;nbsp; or proc step, not in open code as you have it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so your datastep code should look something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hos_date = dhms("&amp;amp;curdate"d,0,0,0):&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DATA safety_hrs;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; INFILE getin missover firstobs=4;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; INPUT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2&amp;nbsp;&amp;nbsp; STATION&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @12&amp;nbsp; CONTR_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $8.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @27&amp;nbsp; CONTR_NAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $35.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @81&amp;nbsp; PRIM_SVC_AREA_ID $6.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @91&amp;nbsp; DRIVER_NBR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $7.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @102 DRIVER_NAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $35. &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @145 PCK_DELV_HRS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.2&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @161 SPOT_HRS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.2&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @177 LINEHAUL_HRS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if PCK_DELV_HRS = . then PCK_DELV_HRS = 0.00; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if SPOT_HRS = . then SPOT_HRS = 0.00;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if LINEHAUL_HRS = . then LINEHAUL_HRS = 0.00; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; hos_date = dhms("&amp;amp;curdate"d,0,0,0):&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using macro variable, as in most other languages which use macros, you have two-step process in parsing code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;step 1. Macro processor (or pre-compiler) reads submitted code and determines if it needs to make substitutions and then makes substitutions if needed, It then submits the statement to data step compiler or procedure processor. &lt;/P&gt;&lt;P&gt;Step 2.&amp;nbsp; The data step compiler parses the code in two passes, compiles the code and executes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the modified code above, the macro processor&lt;/P&gt;&lt;P&gt;1. simply passes the first 17 lines (data ....line_haul_rs = 0.0; .) to the data step compiler&lt;/P&gt;&lt;P&gt;2. substitutes the value of curdate and passes&amp;nbsp; hos_date = dhms("7/22/2012"d,0,0,0): to data setp compiler.&lt;/P&gt;&lt;P&gt;3. passes run statement to compiler which then compiles and runs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 15:19:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84750#M24250</guid>
      <dc:creator>LarryWorley</dc:creator>
      <dc:date>2013-07-22T15:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84751#M24251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I missed the use of colon that Reeza pointed out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 15:21:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84751#M24251</guid>
      <dc:creator>LarryWorley</dc:creator>
      <dc:date>2013-07-22T15:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84752#M24252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, you don't even need the macro variable, just replace the hos_date in the SQL query with the date() call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;insert into safety.safety_hrs_svc&lt;/P&gt;&lt;P&gt;select dhms(date(),0,0,0) as hos_date, STATION, CONTR_ID, CONTR_NAME, PRIM_SVC_AREA_ID, DRIVER_NBR, DRIVER_NAME, PCK_DELV_HRS, SPOT_HRS, LINEHAUL_HRS from work.safety_hrs;&lt;/P&gt;&lt;P&gt;quit; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Anything is easy when you know how and everything's hard when you don't know how.&lt;/STRONG&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 15:23:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84752#M24252</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-07-22T15:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84753#M24253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BINGO... REEZA.&amp;nbsp;&amp;nbsp; This works........select dhms("&amp;amp;curdate"d,0,0,0) as hos_date,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Larry, I indeed did click on the links you sent.&amp;nbsp; Why do you assume I didn't ?&amp;nbsp;&amp;nbsp; Being so fresh, much of this is foreign to me, and it didn't make much sense.&amp;nbsp; I'm not sure how deep I need delve into the world of SAS, as I inhereited a process to look after temporarily and it's in SAS.&amp;nbsp; SAS is not my primary language I code in, and I doubt I'll need it a whole bunch going forward.&amp;nbsp;&amp;nbsp; THAT SAID.&amp;nbsp; I appreciate you all taking the time to help me out, and I do see some neat features and benefits of using this as a primary language.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 16:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84753#M24253</guid>
      <dc:creator>Fleroo</dc:creator>
      <dc:date>2013-07-22T16:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84754#M24254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fleroo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mea Culpa.&amp;nbsp; I was frustrated and vented in the wrong direction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 17:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84754#M24254</guid>
      <dc:creator>LarryWorley</dc:creator>
      <dc:date>2013-07-22T17:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84755#M24255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;larry, Fleero&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The frustration about something at first looking that simple as date/time is quite understable.&lt;/P&gt;&lt;P&gt;Having been involved (set up testing facilties) with milo-testing time/date shifts the incredible complexity of dates became fully visable.&lt;BR /&gt;And even that you have not seen a glimse of discrepandancies of date/time indications used in the world. It is part of NLS support (National Language) and all SAS/Access parts (including Excel).&amp;nbsp; Just recently some standards have been set: ISO8601 an those are not widley published/known. &lt;BR /&gt;You will be able to find references to those at SAS documentation when needed now.&amp;nbsp;&amp;nbsp; But they are not SAS specific, in contrary it is usable everywhere.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 17:36:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84755#M24255</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-07-22T17:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84756#M24256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiya Fleroo. Sorry I was not clear enough when I said dhms(yourdate,0,0,0); I assumed that you already knew about date literals and the fact that general dates were stored as numbers (so you can't pass a date macro into it without the literal).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You know what they say about assumptions!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But yeah, in the long run, spend some time looking up how dates are stored within sas (and all systems) and understanding things like "formatting does not change date values etc" and it will greatly benefit your knowledge of not just sas, but all coding languages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see many new users have this exact problem when not recognizing the difference between datetimes and dates!&lt;/P&gt;&lt;P&gt;Glad we could all help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 17:43:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84756#M24256</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-07-22T17:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Date from SAS showing 1/1/1960</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84757#M24257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oracle does not have a DATE data type. It stores dates as DATETIME and suppresses the time when displaying the value.&lt;/P&gt;&lt;P&gt;When SAS inserts into Oracle tables it does not always (or is that never?) verify that you aren't inserting apples into the oranges field.&lt;/P&gt;&lt;P&gt;Either convert the variable in your SAS table to a DATETIME value ( "&amp;amp;CURDATE:00:00"dt ) or add code in the INSERT statement to convert the DATE value to a DATETIME value (&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;select dhms(HOS_DATE,0,0,0) ... ).&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 05:39:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-from-SAS-showing-1-1-1960/m-p/84757#M24257</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-07-23T05:39:42Z</dc:date>
    </item>
  </channel>
</rss>

