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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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