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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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