BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DavidPhillips2
Rhodochrosite | Level 12

For some reason when I try to write this SAS table to and Oracle table of time date the date in the oracle table shows 1960.  I know I'm missing something simple.

 

proc sql;
create table test1
(academic_period_time date);
quit;

proc sql;
insert into test1(academic_period_time)
values('05MAY2023'D,);
quit;

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

Oracle stores datetimes, not dates.

SAS should translate for you, but seems not to here.

Try

insert into test1(academic_period_time) values('05MAY2023:0:0'dt);

View solution in original post

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

Oracle stores datetimes, not dates.

SAS should translate for you, but seems not to here.

Try

insert into test1(academic_period_time) values('05MAY2023:0:0'dt);
Tom
Super User Tom
Super User

Yes. You are missing the fact that Oracle does not actual have a DATE data type.  It only has DATETIME.  Any reasonable number of days will look like some time early in the morning of January first 1960.

 

I would work better to just use SAS code to add data, but if you want to use the SQL INSERT statement then give it a datetime value.

values('05MAY2023:00:00'DT)

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 639 views
  • 1 like
  • 3 in conversation