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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1348 views
  • 0 likes
  • 4 in conversation