Converting SAS datetime to oracle_datetime


/ Published in: SAS
Save to your folder(s)

Annoyingly hard to find, I'm sure others out there have felt the pain of converting sas dates to oracle date formats.

example:
data _null_;
x_dt = datetime();
x_d = date();
put x_dt oracle_datetime.;
put x_d oracle_date.;
run;


Copy this code and paste it in your HTML
  1. proc format library=your.formats.library;
  2. picture oracle_datetime other='%0d/%0m/%0Y %0H:%0M:%0S' (datatype=datetime);
  3. run;
  4.  
  5. proc format library=your.formats.library;
  6. picture oracle_date other='%0d-%0b-%0Y' (datatype=date);
  7. run;
  8.  
  9. proc format library=your.formats.library;
  10. picture oracle_time other='%0H:%0M:%0S' (datatype=time);
  11. run;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.