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

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