Hi,
I tried the code below where the informat statement was used:
*------------;
data name;
informat FirstName $8. LastName $15. date mmddyy8. n2 7.3;
input firstname $ lastname $ date n2;
datalines;
a b 010101 100
;
*------------;
All the variables are displayed correctly except date. It displayed as a strange numeric value 14976 instead of a date format. Can anyone give some hints on where is wrong?
Thanks!
gim
SAS stores a date internally as the number of days since January 1, 1960. If you don't give the variable a format when you print it, you will get the internally stored value. Try printing with the mmddyy10. format.
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!