I think substr could be use both numeric and charteric variables. But I have used 'PUT' to change first.
The "str" portion of "substr" implies that you are working with a string, or character variables.
Yes you can convert your numeric variable to a character variable by using the Put function or by creating a new character variable equal to your numeric variable, but in the end the substr function is still evaluating a character string.
It is probably in your best interest to use one of the alternative methods provided here on the thread however.
They are a lot simpler.
Thanks for taking time to explaining to me.
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.