BookmarkSubscribeRSS Feed
ybz12003
Rhodochrosite | Level 12

Hello, 

I have a proc freq program list below. I would like to create a macro list for the LabIDs, the percentage of which is over 5%.  Is there a way to do so?  Thanks.

proc freq data=sample;
table LabIDs*test_order_codes*test_result_codes / list missing;
run;
1 REPLY 1
ballardw
Super User

I strongly suggest providing an example data set and then show us which of the percentages that will appear in  Lab_id that you are asking about.

Here is an example of creating a data set with the output percentages that you should be able to run to see what I mean:

proc freq data=sashelp.cars ;
  table origin*make*type/out=work.percent outpct ;
run;

 

Then it may be time to discuss how you intend to use that list of variables. it may be better to generate a data set(hint: likely needed for the macro approach) and use the values in the data set.

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 293 views
  • 3 likes
  • 2 in conversation