DATA Step, Macro, Functions and more

Add commas to dollar value in PROC REPORT

Accepted Solution Solved
Reply
Contributor svh
Contributor
Posts: 21
Accepted Solution

Add commas to dollar value in PROC REPORT

I am not having much luck applying a format to a specific value in a column in PROC REPORT. In my case, I have different metrics that have different forms (some are percentages, for example, and others are dollar values). 

 

However, when I run the following code, my dollar figures are in the form $XXXXXXXXX.XX. I seem to be missing something, and I can't seem to find an answer in the documentation. (I get the same error when I try to apply the format in PROC PRINT, by the way).

 

proc report nowd data=work.bot_test4;
	column metrics combined_value source;
	compute combined_value;
	if substr(metrics, 1, 1)= "$" then do;
 		call define(_col_,'format','Dollar14.2');
      end;
   endcomp;
run;

 

 


Accepted Solutions
Solution
‎03-14-2018 02:42 PM
Respected Advisor
Posts: 3,258

Re: Add commas to dollar value in PROC REPORT

One possibility is that you don't have a wide enough format.

 

Instead of dollar14.2, try dollar20.2

--
Paige Miller

View solution in original post


All Replies
Solution
‎03-14-2018 02:42 PM
Respected Advisor
Posts: 3,258

Re: Add commas to dollar value in PROC REPORT

One possibility is that you don't have a wide enough format.

 

Instead of dollar14.2, try dollar20.2

--
Paige Miller
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 110 views
  • 1 like
  • 2 in conversation