Hi SAS Communities,
The original data of Bithmonth and Birthday does not have a leading zero, so if I code in the following way, when I put FORMAT BirthDt MMDDYY10.; some of the data will show up ****. Do you mind telling me how I can add leading zero in my code, please?
Here is my code:
BirthDt = CATS(BirthYear, BirthMonth, BirthDay);
Thanks,
Valerie
CATS is a character function, but SAS dates are numeric. SAS dates are a count of days with 1960-01-01 as day zero.
To create a date from separate year/month/day values, you use the MDY function:
BirthDt = mdy(BirthMonth,BirthDay,BirthYear);
Then the format will work (for reasonable values of year).
CATS is a character function, but SAS dates are numeric. SAS dates are a count of days with 1960-01-01 as day zero.
To create a date from separate year/month/day values, you use the MDY function:
BirthDt = mdy(BirthMonth,BirthDay,BirthYear);
Then the format will work (for reasonable values of year).
Dates are numeric and CATS is applied to character values..
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.