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***.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.