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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 725 views
  • 0 likes
  • 3 in conversation