BookmarkSubscribeRSS Feed
SASnewbie4
Calcite | Level 5

Suppose I got Order placed from US, CA Today, so I call the macro and it will split the master data into 2 data US and CA having those observation. Tomorrow suppose I have order placed from CH, JP, IN and AU, I call same macro and it will split master data into 4 smaller Data.
Example input: %macroname('US', 'CA') or %macroname('CH', 'JP', 'AU', 'IN')

4 REPLIES 4
Reeza
Super User
And the general advice is don't do this, it's usually inefficient for whatever else you're trying to do.
SASnewbie4
Calcite | Level 5

Thanks for replying.

 

I just started learning SAS and so I am wondering if there is a way to do it. I did go through the link you shared with me but what I am trying to figure out is if I can split the data based on the Macro I call (For Example: %macroname('US', 'CA') or %macroname('CH', 'JP', 'AU', 'IN')). I am not even sure if it can be done as I have been looking for a solution for the past few days now but with no luck. 

 

Please help if you can. Thanks again.

novinosrin
Tourmaline | Level 20

HI @SASnewbie4  Welcome to the SAS forum. 

 

You should be able to find your answer in this thread

https://communities.sas.com/t5/New-SAS-User/Using-an-Array-to-output-multiple-datasets-by-year-of-re...

 

 

Take @hashman  's solution with eyes closed. Supposing you are not aware who is hashman, the only way to put that is there is perhaps only one synonym of SAS and that's that. 

 

Guru @hashman  Sorry for the plug early morning, but i thought to get a newbie to peek your addr and poke the hash. 🙂

 

 

 

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