BookmarkSubscribeRSS Feed
jss539
Fluorite | Level 6

Hello, I am using a macro to reshape a large dataset (%makewide) and am running into the problem of having 150 different variables I want to put as one of the parameters.  Is there a way to do this without manually typing every single variable?

 

Thanks in advance.

2 REPLIES 2
ballardw
Super User

What are you doing with the other variables?

And it might help to show the code for your "makewide" macro.

 

 

Reeza
Super User

It depends on how the macro is coded. There are ways to provide variable lists but the macro may not be designed for that so the answer to your question is maybe....

 

Here is a reference that illustrates how to refer to variables and datasets in a short cut list:
https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html

 


@jss539 wrote:

Hello, I am using a macro to reshape a large dataset (%makewide) and am running into the problem of having 150 different variables I want to put as one of the parameters.  Is there a way to do this without manually typing every single variable?

 

Thanks in advance.


 

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