Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

converting a date in sas

Status
Not open for further replies.

sap1958

Technical User
Oct 22, 2009
138
0
0
US
data Customer2;
set Customer1;
format TotalSalary Dollar10.2;
format Birthdate MMDDYY10.;
run;

In Customer1 the date is in this format 22AUG1966:00:00:00
I used this formula to convert the date to the desired format of 08/22/1966. It would be the same for other dates. However the code is not converting the date as I want. Any ideas as to why.
 
Just to make sure: the SAS format basically changes the >output< format, it does not change the content of the variable. You read in a datetime, you want date only displayed. Add line "BirthDate = datepart(BirthDate);" and you should be set.

Cheers,
Matthias
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top