dear SAS experts,
I want to save a numeric data under a format like : 111.222.020,33 in a macrovariable in order to use it in a sentence in an email afterwards.
The original format of the variable 'Volumen' is: 111222020.33 and I want : 111.222.020,33
I tried the following, but it didn't work. What should I change?
data Ergebnis4;
set Ergebnis3;
format Volumen numx17.2;
call symput('Volumen', Volumen);
run;
%put &Volumen.;
regards
I think you want the COMMAX. format.
data _null_;
set Ergebnis3;
call symputx('Volumen', put(Volumen,commax16.2));
run;
I think you want the COMMAX. format.
data _null_;
set Ergebnis3;
call symputx('Volumen', put(Volumen,commax16.2));
run;
thank you Paige, it worked exactly as I wanted!
You can use the following format ("semi-french"):
data Ergebnis4;
volumen = 111222020.33;
call symput('Volumen', put(Volumen,commax17.2));
run;
%put &Volumen.;
If you want all 17 characters (including leading blanks) in your macro variable, use:
data Ergebnis4;
set Ergebnis3;
call symput('Volumen', put(Volumen, numx17.2));
run;
If you want to get rid of the leading blanks, switch from SYMPUT to SYMPUTX.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.