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;
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.
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!
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.