<?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 SAS TIMESTAMP in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SAS-TIMESTAMP/m-p/62124#M1500</link>
    <description>Hi Iam trying  To load data from SAS datasets into a schema in OC for&lt;BR /&gt;
                          processing with eLoader. But time is showing as 'TIMESTAMP'.&lt;BR /&gt;
Here not showing time, just showing a word as TIMESTAMP.&lt;BR /&gt;
Could you please resolve my code:-&lt;BR /&gt;
&lt;BR /&gt;
%let userid=%sysget(USERID);&lt;BR /&gt;
%let passwd=%sysget(PASSWD);&lt;BR /&gt;
%let dbpath=OCGVPRD1;&lt;BR /&gt;
%let sasdir=%sysget(FNAME);&lt;BR /&gt;
%let exclude=%sysget(VIEW);&lt;BR /&gt;
&lt;BR /&gt;
%put exclude=&amp;amp;exclude;&lt;BR /&gt;
&lt;BR /&gt;
libname drop oracle user= &amp;amp;userid &lt;BR /&gt;
                      password= &amp;amp;passwd &lt;BR /&gt;
                      path = "&amp;amp;dbpath" ; &lt;BR /&gt;
proc datasets lib=drop&lt;BR /&gt;
kill;&lt;BR /&gt;
quit;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
libname cdwdir oracle user= "&amp;amp;userid" &lt;BR /&gt;
                      password= "&amp;amp;passwd" &lt;BR /&gt;
                      path = "&amp;amp;dbpath" ; &lt;BR /&gt;
&lt;BR /&gt;
libname source "&amp;amp;SASDIR";&lt;BR /&gt;
 &lt;BR /&gt;
%macro search(path);&lt;BR /&gt;
   %local filrf rc did memct filename file i path;&lt;BR /&gt;
&lt;BR /&gt;
   %let filrf=mydir;&lt;BR /&gt;
    %let rc=%sysfunc(filename(filrf,&amp;amp;path));&lt;BR /&gt;
    %let did=%sysfunc(dopen(&amp;amp;filrf));&lt;BR /&gt;
    %let memct=%sysfunc(dnum(&amp;amp;did));&lt;BR /&gt;
     %do i=1 %to &amp;amp;memct;&lt;BR /&gt;
     %let filename=%sysfunc(dread(&amp;amp;did,&amp;amp;i));&lt;BR /&gt;
         %let file=%scan(&amp;amp;filename,1,.);&lt;BR /&gt;
     %if %index(%upcase(&amp;amp;filename),.SAS7BDAT) %then %do;&lt;BR /&gt;
      &lt;BR /&gt;
proc sql; &lt;BR /&gt;
 /*    drop table cdwdir.&amp;amp;file; */&lt;BR /&gt;
&lt;BR /&gt;
     create table cdwdir.&amp;amp;file as &lt;BR /&gt;
     select * from source.&amp;amp;file; &lt;BR /&gt;
&lt;BR /&gt;
quit; &lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
   connect to oracle (user= &amp;amp;userid &lt;BR /&gt;
                      password= &amp;amp;passwd &lt;BR /&gt;
                      path = "&amp;amp;dbpath");&lt;BR /&gt;
   execute (grant select on &amp;amp;file &lt;BR /&gt;
            to e_usr) by oracle;&lt;BR /&gt;
   disconnect from oracle;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
     %end;&lt;BR /&gt;
  %end;&lt;BR /&gt;
  %let rc=%sysfunc(dclose(&amp;amp;did));&lt;BR /&gt;
  %let rc=%sysfunc(filename(filrf));&lt;BR /&gt;
 %mend;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
************************************************************************************&lt;BR /&gt;
&lt;BR /&gt;
 Get variables for redirecting log file, remove any trailing blanks from variables&lt;BR /&gt;
 used to contruct the name of the log file.&lt;BR /&gt;
&lt;BR /&gt;
***********************************************************************************;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
dt=today();&lt;BR /&gt;
chardt=put(dt,date9.);&lt;BR /&gt;
dir   = "&amp;amp;SASDIR"; &lt;BR /&gt;
study = "&amp;amp;USERID";&lt;BR /&gt;
call symput('TODAYDT',compress(chardt,':'));&lt;BR /&gt;
call symput('DIR',trim(DIR));&lt;BR /&gt;
call symput('STUDY',trim(STUDY));&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
filename logfile "&amp;amp;DIR.&amp;amp;STUDY._load_&amp;amp;TODAYDT..log";&lt;BR /&gt;
&lt;BR /&gt;
proc printto log=logfile new;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
  %search(&amp;amp;SASDIR);&lt;BR /&gt;
&lt;BR /&gt;
************************************************************************************&lt;BR /&gt;
&lt;BR /&gt;
Section setting to uppercase all character fields in the tables loaded.&lt;BR /&gt;
&lt;BR /&gt;
1) Create temp table with table name and column name for character variables&lt;BR /&gt;
&lt;BR /&gt;
2) Use this in a loop with update table_name &lt;BR /&gt;
                           set column_name = upper(column_name);&lt;BR /&gt;
&lt;BR /&gt;
***********************************************************************************;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
&lt;BR /&gt;
drop table var_cols;&lt;BR /&gt;
&lt;BR /&gt;
create table var_cols as &lt;BR /&gt;
select &lt;BR /&gt;
       a.table_name as tabname&lt;BR /&gt;
,      a.column_name as colname       &lt;BR /&gt;
,      a.data_type&lt;BR /&gt;
from&lt;BR /&gt;
       cdwdir.user_tab_columns a&lt;BR /&gt;
where &lt;BR /&gt;
       data_type like '%CHAR%'&lt;BR /&gt;
       &amp;amp;exclude&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
&lt;BR /&gt;
drop table upc;&lt;BR /&gt;
create table upc as &lt;BR /&gt;
select 'update cdwdir.'||trim(tabname)||' set '||trim(colname)||' = upcase('||trim(colname)||');' as &lt;BR /&gt;
&lt;BR /&gt;
statement&lt;BR /&gt;
from &lt;BR /&gt;
var_cols;&lt;BR /&gt;
&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
set upc end=eof;&lt;BR /&gt;
call symput(trim('ref'||left(_n_)),statement);&lt;BR /&gt;
if eof then call symput('total',_n_);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
%macro runit;&lt;BR /&gt;
%local i;&lt;BR /&gt;
%do i=1 %to &amp;amp;total;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
        &amp;amp;&amp;amp;ref&amp;amp;i;&lt;BR /&gt;
quit;&lt;BR /&gt;
%end;&lt;BR /&gt;
%mend runit;&lt;BR /&gt;
&lt;BR /&gt;
%runit;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc printto log=log;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
************************************************************************************&lt;BR /&gt;
&lt;BR /&gt;
Clean up temp datasets (temp, upc &amp;amp; var_cols) as appropriate.&lt;BR /&gt;
&lt;BR /&gt;
***********************************************************************************;&lt;BR /&gt;
&lt;BR /&gt;
proc datasets library = work;&lt;BR /&gt;
delete temp upc var_cols;&lt;BR /&gt;
run;&lt;BR /&gt;
quit;</description>
    <pubDate>Thu, 25 Feb 2010 18:08:35 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-02-25T18:08:35Z</dc:date>
    <item>
      <title>SAS TIMESTAMP</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SAS-TIMESTAMP/m-p/62124#M1500</link>
      <description>Hi Iam trying  To load data from SAS datasets into a schema in OC for&lt;BR /&gt;
                          processing with eLoader. But time is showing as 'TIMESTAMP'.&lt;BR /&gt;
Here not showing time, just showing a word as TIMESTAMP.&lt;BR /&gt;
Could you please resolve my code:-&lt;BR /&gt;
&lt;BR /&gt;
%let userid=%sysget(USERID);&lt;BR /&gt;
%let passwd=%sysget(PASSWD);&lt;BR /&gt;
%let dbpath=OCGVPRD1;&lt;BR /&gt;
%let sasdir=%sysget(FNAME);&lt;BR /&gt;
%let exclude=%sysget(VIEW);&lt;BR /&gt;
&lt;BR /&gt;
%put exclude=&amp;amp;exclude;&lt;BR /&gt;
&lt;BR /&gt;
libname drop oracle user= &amp;amp;userid &lt;BR /&gt;
                      password= &amp;amp;passwd &lt;BR /&gt;
                      path = "&amp;amp;dbpath" ; &lt;BR /&gt;
proc datasets lib=drop&lt;BR /&gt;
kill;&lt;BR /&gt;
quit;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
libname cdwdir oracle user= "&amp;amp;userid" &lt;BR /&gt;
                      password= "&amp;amp;passwd" &lt;BR /&gt;
                      path = "&amp;amp;dbpath" ; &lt;BR /&gt;
&lt;BR /&gt;
libname source "&amp;amp;SASDIR";&lt;BR /&gt;
 &lt;BR /&gt;
%macro search(path);&lt;BR /&gt;
   %local filrf rc did memct filename file i path;&lt;BR /&gt;
&lt;BR /&gt;
   %let filrf=mydir;&lt;BR /&gt;
    %let rc=%sysfunc(filename(filrf,&amp;amp;path));&lt;BR /&gt;
    %let did=%sysfunc(dopen(&amp;amp;filrf));&lt;BR /&gt;
    %let memct=%sysfunc(dnum(&amp;amp;did));&lt;BR /&gt;
     %do i=1 %to &amp;amp;memct;&lt;BR /&gt;
     %let filename=%sysfunc(dread(&amp;amp;did,&amp;amp;i));&lt;BR /&gt;
         %let file=%scan(&amp;amp;filename,1,.);&lt;BR /&gt;
     %if %index(%upcase(&amp;amp;filename),.SAS7BDAT) %then %do;&lt;BR /&gt;
      &lt;BR /&gt;
proc sql; &lt;BR /&gt;
 /*    drop table cdwdir.&amp;amp;file; */&lt;BR /&gt;
&lt;BR /&gt;
     create table cdwdir.&amp;amp;file as &lt;BR /&gt;
     select * from source.&amp;amp;file; &lt;BR /&gt;
&lt;BR /&gt;
quit; &lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
   connect to oracle (user= &amp;amp;userid &lt;BR /&gt;
                      password= &amp;amp;passwd &lt;BR /&gt;
                      path = "&amp;amp;dbpath");&lt;BR /&gt;
   execute (grant select on &amp;amp;file &lt;BR /&gt;
            to e_usr) by oracle;&lt;BR /&gt;
   disconnect from oracle;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
     %end;&lt;BR /&gt;
  %end;&lt;BR /&gt;
  %let rc=%sysfunc(dclose(&amp;amp;did));&lt;BR /&gt;
  %let rc=%sysfunc(filename(filrf));&lt;BR /&gt;
 %mend;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
************************************************************************************&lt;BR /&gt;
&lt;BR /&gt;
 Get variables for redirecting log file, remove any trailing blanks from variables&lt;BR /&gt;
 used to contruct the name of the log file.&lt;BR /&gt;
&lt;BR /&gt;
***********************************************************************************;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
dt=today();&lt;BR /&gt;
chardt=put(dt,date9.);&lt;BR /&gt;
dir   = "&amp;amp;SASDIR"; &lt;BR /&gt;
study = "&amp;amp;USERID";&lt;BR /&gt;
call symput('TODAYDT',compress(chardt,':'));&lt;BR /&gt;
call symput('DIR',trim(DIR));&lt;BR /&gt;
call symput('STUDY',trim(STUDY));&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
filename logfile "&amp;amp;DIR.&amp;amp;STUDY._load_&amp;amp;TODAYDT..log";&lt;BR /&gt;
&lt;BR /&gt;
proc printto log=logfile new;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
  %search(&amp;amp;SASDIR);&lt;BR /&gt;
&lt;BR /&gt;
************************************************************************************&lt;BR /&gt;
&lt;BR /&gt;
Section setting to uppercase all character fields in the tables loaded.&lt;BR /&gt;
&lt;BR /&gt;
1) Create temp table with table name and column name for character variables&lt;BR /&gt;
&lt;BR /&gt;
2) Use this in a loop with update table_name &lt;BR /&gt;
                           set column_name = upper(column_name);&lt;BR /&gt;
&lt;BR /&gt;
***********************************************************************************;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
&lt;BR /&gt;
drop table var_cols;&lt;BR /&gt;
&lt;BR /&gt;
create table var_cols as &lt;BR /&gt;
select &lt;BR /&gt;
       a.table_name as tabname&lt;BR /&gt;
,      a.column_name as colname       &lt;BR /&gt;
,      a.data_type&lt;BR /&gt;
from&lt;BR /&gt;
       cdwdir.user_tab_columns a&lt;BR /&gt;
where &lt;BR /&gt;
       data_type like '%CHAR%'&lt;BR /&gt;
       &amp;amp;exclude&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
&lt;BR /&gt;
drop table upc;&lt;BR /&gt;
create table upc as &lt;BR /&gt;
select 'update cdwdir.'||trim(tabname)||' set '||trim(colname)||' = upcase('||trim(colname)||');' as &lt;BR /&gt;
&lt;BR /&gt;
statement&lt;BR /&gt;
from &lt;BR /&gt;
var_cols;&lt;BR /&gt;
&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
set upc end=eof;&lt;BR /&gt;
call symput(trim('ref'||left(_n_)),statement);&lt;BR /&gt;
if eof then call symput('total',_n_);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
%macro runit;&lt;BR /&gt;
%local i;&lt;BR /&gt;
%do i=1 %to &amp;amp;total;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
        &amp;amp;&amp;amp;ref&amp;amp;i;&lt;BR /&gt;
quit;&lt;BR /&gt;
%end;&lt;BR /&gt;
%mend runit;&lt;BR /&gt;
&lt;BR /&gt;
%runit;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc printto log=log;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
************************************************************************************&lt;BR /&gt;
&lt;BR /&gt;
Clean up temp datasets (temp, upc &amp;amp; var_cols) as appropriate.&lt;BR /&gt;
&lt;BR /&gt;
***********************************************************************************;&lt;BR /&gt;
&lt;BR /&gt;
proc datasets library = work;&lt;BR /&gt;
delete temp upc var_cols;&lt;BR /&gt;
run;&lt;BR /&gt;
quit;</description>
      <pubDate>Thu, 25 Feb 2010 18:08:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SAS-TIMESTAMP/m-p/62124#M1500</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-02-25T18:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS TIMESTAMP</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SAS-TIMESTAMP/m-p/62125#M1501</link>
      <description>What's unclear from the OP submission - "But time is showing as 'TIMESTAMP'."&lt;BR /&gt;
&lt;BR /&gt;
What time variable is showing up as TIMESTAMP?&lt;BR /&gt;
&lt;BR /&gt;
It would be useful to see SAS log with generated diagnostics and/or resolved macro code and variables which demonstrates the specific problem symptom encountered.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 25 Feb 2010 18:29:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SAS-TIMESTAMP/m-p/62125#M1501</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-02-25T18:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS TIMESTAMP</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SAS-TIMESTAMP/m-p/62126#M1502</link>
      <description>Thanks Scott,&lt;BR /&gt;
No isue from sas side, when i sending to oracle clinical then showing the word as TIMESTAMP instead of dates for all date filelds.&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Pr</description>
      <pubDate>Thu, 25 Feb 2010 18:57:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SAS-TIMESTAMP/m-p/62126#M1502</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-02-25T18:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS TIMESTAMP</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SAS-TIMESTAMP/m-p/62127#M1503</link>
      <description>Help explain what you mean by: "...showing the word as TIMESTAMP...".&lt;BR /&gt;
&lt;BR /&gt;
I suspect you will want to share your "generated" SAS code in a log with all available diagnostics - post another reply here with the info pasted.&lt;BR /&gt;
&lt;BR /&gt;
Some key SAS code to help reveal what's useful:&lt;BR /&gt;
&lt;BR /&gt;
OPTIONS SOURCE SOURCE2 MACROGEN SYMBOLGEN MPRINT;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 26 Feb 2010 15:33:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SAS-TIMESTAMP/m-p/62127#M1503</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-02-26T15:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS TIMESTAMP</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SAS-TIMESTAMP/m-p/62128#M1504</link>
      <description>try with the option "sasdateformat" in connection statement. Check in page no 5.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_91/access_oracle_7367.pdf" target="_blank"&gt;http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_91/access_oracle_7367.pdf&lt;/A&gt;</description>
      <pubDate>Tue, 16 Nov 2010 17:27:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SAS-TIMESTAMP/m-p/62128#M1504</guid>
      <dc:creator>sivaji</dc:creator>
      <dc:date>2010-11-16T17:27:36Z</dc:date>
    </item>
  </channel>
</rss>

