BookmarkSubscribeRSS Feed
Fluorite | Level 6



I'm working with a dataset that has a list of action items where each action item has the owner name. Note that some owner has more than one action item.


My goal is to take the list of action items, divide them up by each owner, and email that Excel sheet to each owner. I'm pretty new to SAS Macros and I'm having difficulty thinking of what's the best way to do it. Currently, I'm writing code specific to each owner:


data ownername1;

set all;

if owner=owner1;



data ownername2;

set alll

if owner=owner2;





Then I'm going to proc export for each owner dataset and have SAS email out that report, however, I don't want an email to be sent if there are no action items. Clearly this is taking a lot of time and I can't help but think there's a better way to do this. Any ideas to get me started?





Super User

Hard to say with just what you've posted here. It depends on how much difference there is between each 'action'.


It could be easy to say, create a macro for each action and then use call execute to loop through your list and execute the correct macro for each user. 

Or a generic macro that takes the action for each user and somehow filters out the correct action so the action is a parameter to the macro. 

Fluorite | Level 6

Hi Reeza,


There's no real difference between the actions. Either the "Description" column has some detail in it, or it's blank (blank meaning that there are no action items). 


Do you have any basic macro literature I can look at? I've googled my situation and the macros that might be helpful are way too complex for me at this point.



Super User

Basic Intro here:


Then read through the examples:


The examples have most of what people should need for a starter. 

Then search through lexjansen for any number of papers on the topic:




The early bird rate has been extended! Register by March 18 for just $695 - $100 off the standard rate.


Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 


Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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