Hi @Risi
You can try this:
NB: The WORDSw. format converts numeric values to their equivalent in English words.
data have; input V1$; datalines; one two three seven ; run; data convert; do num=1 to 100; V1=put(num,words100.); output; end; run; proc sql noprint; create table want as select a.V1, b.num from have as a left join convert as b on a.V1 = b.V1 order by a.V1; quit;
Have
Want
Hi @Risi
You can try this:
NB: The WORDSw. format converts numeric values to their equivalent in English words.
data have; input V1$; datalines; one two three seven ; run; data convert; do num=1 to 100; V1=put(num,words100.); output; end; run; proc sql noprint; create table want as select a.V1, b.num from have as a left join convert as b on a.V1 = b.V1 order by a.V1; quit;
Have
Want
Use the words format.
Details matter.
Do you mean to change a TEXT value of 'one' to a numeric value of 1 for computation?
Or just to display a text value of 'one' as text value of '1'?
How many of these the text values are involved? Just 'one' and 'two' or a large number? Are there other text values in the variable that are not "numbers" such as "NA" or "missing".
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.