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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 568 views
  • 3 likes
  • 2 in conversation