The SAS Output Delivery System and reporting techniques

strange things in using INFORMAT.

Reply
N/A
Posts: 0

strange things in using INFORMAT.

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
Contributor
Posts: 29

Re: strange things in using INFORMAT.

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.
Ask a Question
Discussion stats
  • 1 reply
  • 112 views
  • 0 likes
  • 2 in conversation