Hi All, I trying to send emails to different users, i have written two SAS macros let's say Macro A, and Macro B. for certain reasons i am not able to share the code here as i am working on secured network, but I will try my best to explain what the two macro do. Macro A.: Macro creates a table for each department (i.e. Dept A, B ,C) the macro creates the Subset of data from the Repository for the mentioned period. which will extract the details of the Sales, location, Product and user details like Name of the user, email id. Macro B: Macro creates the intermediate tables which will have details of the user, and his Sales data viz, Sales for each location summaries the data for each salesperson, for each location he is responsible. and emails the information to him and his manager. when i am running the the SAS Macro for Dept A, Dept B and Dept C individually i am able to get the desired results. for ex. Dept A has 2 sales done by Salesperson XYZ, the Salesperson and his manager is receiving emails for the 2 sales made by him for the Week. Similarly Dept B has 1 Sales done by Salesperson ABC the Salesperson and his manager is receiving emails for the 1 sale made by him for the Week. Similarly Dept c has 10 Sales done by Salesperson UVW the Salesperson and his manager is receiving emails for the 10 sales made by him for the Week. Only 3 emails sent for each sale. for the week. I am able to achieve this by running both Macro and Macro B for each Dept, But when i am running it for all the 3 Dept(A,B,C) ii am getting as many as 12 emails. instead of 3 emails. Execution: Macro execution order Macro A; to create the Subset for each dept, and Macro B is called within Macro A, in order to send emails to the Salesperson who has made sales. Could you please suggest me how to Run for all the departments and send emails, as this will run in a Batch in prod environment? Regards,
... View more