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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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