BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
svh
Lapis Lazuli | Level 10 svh
Lapis Lazuli | Level 10

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;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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

1 REPLY 1
PaigeMiller
Diamond | Level 26

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

 

Instead of dollar14.2, try dollar20.2

--
Paige Miller

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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