BookmarkSubscribeRSS Feed
nbonda
Obsidian | Level 7

Hi SAS users,

 

I am using SAS on linux platform.

A date column has been pulled from Oracle, the values wilth two digit year are showing as four year digit in SAS datasets .

for instance the date value in Oracle is 12-Jan-00 12:59:59.99999000 PM, SAS is reading it as 12JAN3000:13:00:00.000000.

 

How sas understanding two digit year 00  as 3000 instead of 2000. I am getting the right year though which is 3000.

 

I have checked the yearcutoff option in my system, its 1920 ( I got this info by using proc option option=yearcutoff;run;)

 

I am uisng SQL pass through to connect to Oracle server.

 

Thank you in advance.

3 REPLIES 3
ballardw
Super User

What is the informat shown for the SAS variable?

 

And I would also ask how you know which century the 12-Jan-00 12:59:59.99999000 value represents?

nbonda
Obsidian | Level 7
In oracle table it two digit year is displaying, but it has 4 digit year. SAS extracting properly only. Thank you for your response.
Patrick
Opal | Level 21

Don't confuse how numbers get printed/formatted with how they are stored.

 

In Oracle a date value is stored in a column of type DATE (which contains a datetime value). SAS will always convert this into the correct SAS Datetime value. The 2 or 4 digit year is only how values get printed, not how they are stored internally.

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
  • 3 replies
  • 907 views
  • 1 like
  • 3 in conversation