BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

hi guys.

When trying to convert this number x=123199  to a date using format date9. i get 4/22/97 but if i use the put + input functions i get different results :

x=123199 ;

xchar = put(x,z6.) ;

xdate = input (xchar, mmddyy6.) ;

format xdate date9. ;

so xdate=31/dec/99 in this case.

So how come?

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Hi,

The string "123199" is read like the date 12/31/99 whereas the number 123199 is the number of days between 01JAN1960 and 22APR2297, which is the date you get when converting 123199 into a date.

PG

PG

View solution in original post

2 REPLIES 2
PGStats
Opal | Level 21

Hi,

The string "123199" is read like the date 12/31/99 whereas the number 123199 is the number of days between 01JAN1960 and 22APR2297, which is the date you get when converting 123199 into a date.

PG

PG
Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

right right,did not think of it!

Thanks so much

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 1238 views
  • 2 likes
  • 2 in conversation