BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PierreYvesILY
Pyrite | Level 9

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

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I think you want the COMMAX. format.

 

data _null_;
set Ergebnis3;
call symputx('Volumen', put(Volumen,commax16.2));
run;
--
Paige Miller

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

I think you want the COMMAX. format.

 

data _null_;
set Ergebnis3;
call symputx('Volumen', put(Volumen,commax16.2));
run;
--
Paige Miller
PierreYvesILY
Pyrite | Level 9

thank you Paige, it worked exactly as I wanted!

ed_sas_member
Meteorite | Level 14

HI @PierreYvesILY 

 

You can use the following format ("semi-french"):


data Ergebnis4;
	volumen = 111222020.33;
	call symput('Volumen', put(Volumen,commax17.2));
run;
%put &Volumen.;
Astounding
PROC Star

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.

PierreYvesILY
Pyrite | Level 9
thanks a lot, I didn't know SYMPUTX yet

SAS Innovate 2025: Call for Content

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!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 5 replies
  • 697 views
  • 3 likes
  • 4 in conversation