BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

i have a date value 2007-10-01(yyyy-dd-mm)in the database..
how to read this date value in sas?

i need format statement for above value


kumar
3 REPLIES 3
LinusH
Tourmaline | Level 20
Concepts about SAS date and time:

http://support.sas.com/documentation/cdl/en/lrcon/59522/HTML/default/a002200738.htm

About reading date format from external databases (i.e. Oracle, SAS/ACCESS to RDBMS):

http://support.sas.com/documentation/cdl/en/acreldb/59618/HTML/default/a003113620.htm

/Linus
Data never sleeps
Patrick
Opal | Level 21
Hi Kumar
This 'date' thing is a very common cause of confusion.
There is a difference of what you see (what you see is what format is applied on a field) and what field type data are stored in.
If the date in your database is already in a field of type 'date' or similar then you won't have problems - just access it with SAS.
It the date is stored as a character string then you will have to tell SAS how to read it - that would then be a Informat. SAS would then convert the string to a SAS date (that's a number). To look at it this SAS data you then best apply a Format to the variable (else you just will see a number).
HTH
Patrick

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 587 views
  • 0 likes
  • 4 in conversation