Help using Base SAS procedures

Date format

Reply
N/A
Posts: 0

Date format

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
Super User
Posts: 5,256

Re: Date format

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
Respected Advisor
Posts: 3,887

Re: Date format

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 Super FREQ
Posts: 8,742

Re: Date format

Ask a Question
Discussion stats
  • 3 replies
  • 132 views
  • 0 likes
  • 4 in conversation