Good Morning,
I am creating a new variable that will store the end of the month data of my "date of service " field. I am using the formula below:
eom_var= intnx('month',serv_from_date,0,'e');
eom_date = put(eom_var, mmddyy10.);
The variable created in the new dataset has a character type. How do I convert this new variable to date field type so I can compare with another dataset whose date variables are all date type.
I am beginner in SA and would greatly appreciate your assistance. Thank you in advance.
eom_var= intnx('month',serv_from_date,0,'e');
eom_date = put(eom_var, mmddyy10.); <- PUT converts the variable to a character. Remove this line.
Instead, add a format to your date so you can see it properly.
eom_date = intnx('month', serv_from_date, 0, 'e');
format eom_date yymmdd10.;
eom_var= intnx('month',serv_from_date,0,'e');
eom_date = put(eom_var, mmddyy10.); <- PUT converts the variable to a character. Remove this line.
Instead, add a format to your date so you can see it properly.
eom_date = intnx('month', serv_from_date, 0, 'e');
format eom_date yymmdd10.;
It worked! Thank you so much!
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.