<?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 Insert Current Date &amp;amp; Time into Oracle record in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Insert-Current-Date-amp-Time-into-Oracle-record/m-p/316033#M68997</link>
    <description>&lt;P&gt;I wanted to get the current date &amp;amp; time to insert &amp;nbsp;in one of the attributes of ORacle Table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried below 2 options &amp;amp; i am getting default date of SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Option 1 :&lt;/P&gt;
&lt;P&gt;data_null_;&lt;/P&gt;
&lt;P&gt;RECORD_DATE &amp;nbsp; = compress(put(today(),yymmddn8.)||'-'||Trim(Left(put(time(),time11.2))),':.')&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Option2 :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC SQL;&lt;BR /&gt;INSERT INTO DBMS.&amp;amp;MyTable (RECORD_DATE, &amp;nbsp;Other attributes )&lt;BR /&gt;SELECT&lt;BR /&gt;DATETIME(),&lt;/P&gt;
&lt;P&gt;Other attributes&lt;BR /&gt;FROM MANUAL_TEMP B&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both are not working to resolve current date &amp;amp; time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Ana&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Mar 2018 16:04:34 GMT</pubDate>
    <dc:creator>SASAna</dc:creator>
    <dc:date>2018-03-06T16:04:34Z</dc:date>
    <item>
      <title>Insert Current Date &amp; Time into Oracle record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-Current-Date-amp-Time-into-Oracle-record/m-p/316033#M68997</link>
      <description>&lt;P&gt;I wanted to get the current date &amp;amp; time to insert &amp;nbsp;in one of the attributes of ORacle Table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried below 2 options &amp;amp; i am getting default date of SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Option 1 :&lt;/P&gt;
&lt;P&gt;data_null_;&lt;/P&gt;
&lt;P&gt;RECORD_DATE &amp;nbsp; = compress(put(today(),yymmddn8.)||'-'||Trim(Left(put(time(),time11.2))),':.')&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Option2 :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC SQL;&lt;BR /&gt;INSERT INTO DBMS.&amp;amp;MyTable (RECORD_DATE, &amp;nbsp;Other attributes )&lt;BR /&gt;SELECT&lt;BR /&gt;DATETIME(),&lt;/P&gt;
&lt;P&gt;Other attributes&lt;BR /&gt;FROM MANUAL_TEMP B&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both are not working to resolve current date &amp;amp; time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Ana&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 16:04:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-Current-Date-amp-Time-into-Oracle-record/m-p/316033#M68997</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2018-03-06T16:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Current Date &amp; Time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-Current-Date-amp-Time-into-Oracle-record/m-p/316037#M68999</link>
      <description>&lt;P&gt;I would try something like this with your preferred date/time format,&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let tday = %sysfunc(today(),yymmddn8.);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Or you could get fancy and do something like this to get HMS,&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  picture myfmt low-high = '%Y%0m%0d_%0H%0M%0S' (datatype = datetime) ;
run ;

%let timestamp=%sysfunc(datetime(), myfmt.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Dec 2016 18:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-Current-Date-amp-Time-into-Oracle-record/m-p/316037#M68999</guid>
      <dc:creator>TheShark</dc:creator>
      <dc:date>2016-12-01T18:40:24Z</dc:date>
    </item>
  </channel>
</rss>

