BookmarkSubscribeRSS Feed
PaigeMiller
Diamond | Level 26

@sahoositaram555 wrote:

Hi @PaigeMiller,

U guessed almost right. %FREQ is a project specific macro to take care of steps from getting a few things done including frequency and further restructuring.However, here my concern involves how to read categorical variables one by one(eg: lets say: sex race disease_status etc.) and i need to use those variables one by one to pass in to %freq(predesigned macro) to finally get different outputs and later combining them (pretty much like a set command to stack up output datasets one upon another. I know, that this thing can be done by using proc freq macro that you have mentioned but i want to use specifically the study designed macro out of compulsion.
Hope you understand and suggest something on this.

Cheers,
Ram


Change the code I wrote to loop the calls to %FREQ. The logic is the same. Loop over the variable names as I have done, selecting one at a time, and then include %FREQ inside the loop.

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 15 replies
  • 2579 views
  • 0 likes
  • 4 in conversation