BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
1 REPLY 1
garybald
Calcite | Level 5
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.

sas-innovate-2026-white.png



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!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1269 views
  • 0 likes
  • 2 in conversation