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

Hello,
I am hoping someone can help me. I am using a multi-select prompt within Enterprise Guide called "Display_Options" and have created the following proc report procedure (which is within a macro) that correctly outputs a table with the columns that are chosen in the prompt. However, the unformatted values of the prompt are displayed, and I would like to display the formatted values. I think I need to assign a format to the label which is in double quotes on the define statement, but I can't figure out how to do that.

Here's the proc report code:

proc report data=WORK.TEMP4 nowd;
column OrgName Provider_Name ProviderID
ConsistentItem1, (%do j=1 %to &Display_Options_count; &&Display_Options&j %end;) ;
define OrgName / group 'Organization Name' format=$100. missing order=formatted;
define Provider_Name / group 'Provider Name' format=$101. missing order=formatted;
define ProviderID / group 'Provider ID' format=$50. missing order=formatted;
define ConsistentItem1 / across '' order=data missing;
%do j=1 %to %eval(&Display_Options_count);
define &&Display_Options&j / analysis SUM format=5.2 "???" missing;
%end;
run;
quit;


Here's the format for the column labels for the possible values for the prompt:

proc format;
value $Display MeanScore = 'Mean'
ItemN= 'Item n'
NumSIDs = 'Number of Respondents'
TopBox = 'Top Box';
run;

I would greatly appreciate any help on this.

Thanks,
KelseyB

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

%do j=1 %to %eval(&Display_Options_count); %let t = %sysfunc(putc(&&Display_Options&j,$Display.)); define &&Display_Options&j / analysis SUM format=5.2 "&t" missing; %end;

This might get you started.

 

View solution in original post

2 REPLIES 2
ballardw
Super User

%do j=1 %to %eval(&Display_Options_count); %let t = %sysfunc(putc(&&Display_Options&j,$Display.)); define &&Display_Options&j / analysis SUM format=5.2 "&t" missing; %end;

This might get you started.

 

KelseyB
Fluorite | Level 6

This worked perfectly ballardw. Thank you!

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
  • 2 replies
  • 566 views
  • 0 likes
  • 2 in conversation