02-27-2012 03:43 PM
I have one question.
I have a numers in commax30. format which are saved in macro variable. (e.g. first numer= 35.258.698, second numer=58.258.369 an so one.., every numer contains 2 dots)
When i try to summarize this two or more numer i get an error bescause numbers has 2 dots.
I tried with more combinations and i do not know how to resolve this problem.
The numbers must be in defined formats commax30. and i do not want define duplicate macro variable just for summarizing.
Does anyone have any idea.
Thx for help.
02-27-2012 04:43 PM
Because my client wants result in this format. 25,598,659 is not acceptable format for my reports.
I can define duplicate macro variable but this is too complicated.
So, i try to fine more elegant solution.
Thx for questions.
02-27-2012 05:39 PM
Couldn't you just use the commaxw.d format for your reports? see:
02-27-2012 05:47 PM
Is it basically the european format for a number, decimal instead of comma?
I think Hima's question needs to be answered, otherwise how do the numbers add together, ie Do all numbers have 2 periods and do all have 8 digits?
Assuming you can't just use the commax format in your final report and store intermediaries in the north american standard notation my suggestion would be to convert to comma notation and the reconvert back to commax format.
%let cvar1=%sysfunc(inputn(&var1, commax30.));
%let cvar2=%sysfunc(inputn(&var2, commax30.));
%put &var1 &var2 &cvar1 &cvar2;
%let sum=%sysfunc(putn(%sysevalf(&cvar1 +&cvar1), commax30.));
03-06-2012 08:54 AM
what about when we have commaxw.d, when d>0?
Thanks in advanced.