Hi Everyone,
I have number 15.699997 and I want to create variable with value 15.69***.
Can you please modify the code below to get it work?
Thanks,
HHC
data have;
input a;
datalines;
15.699997
;
run;
data want;
set have;
c=catt(a, " **** ");
run;
This works for that single value.
God knows why you want that. Smacks of the social sciences * ** and *** for "significance levels"
data have; input a; x = cats(substr(put(a,f9.6),1,5),"***"); datalines; 15.699997 ;
If you have a more generic question you should make it so as the proposed solution won't work for values above 100 most likely and may have issues with small values of A
Thank you for your help.
The *** is just an example. I add text to number.
HHC
@hhchenfx wrote:
Thank you for your help.
The *** is just an example. I add text to number.
HHC
I thought you wanted 15.69***. Using 8.2 format results in 15.70***.
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 save with the early bird rate—just $795!
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.