Conditionally Email

Accepted Solution Solved
Reply
Contributor
Posts: 66
Accepted Solution

Conditionally Email

Hi All,

 

I am trying to Send emails to a group after the files are available for  each department.

 

for example :

Group:- Admins

Department : Sales,Finance, Planning

 

Here Admins is the group which will monitor the extracts from the below three departments, now i am sending three different emails

after the data is extracted from each dept, now the group has requested to send the extract details on a single email.

 

I have tried to create a Macro variable using fileexists as the extract is output to a csv file at a particular location.

%let fldir2="A52091/Admins/Reports/Sales_yymmddhhmmss.csv";

%macro Inp;

%if %sysfunc(fileexist(&fldir2.)) %then

%do;

   %let Sales_Fle=Y;

   %put "The SALES Extract is available";

%end;

%else %do;

   %let Sales_Fle=N;

   %put "The SALES Extract is available";

%end;

%mend Inp;

%inp;

 

Similarly i am creating macro variables for Finance and Planning departments.

Please guide me on how to send the availablity of the Extracts on a Single email.

 

The extract is usually complete by 7.30 AM Mon - Fri excluding Public holidays.

As mentioned the group is currently reciveing 3 emails and have requested to send the availablity on a Single email.

 

Kindly suggest.

 

 

 

 

 


Accepted Solutions
Solution
‎02-06-2017 07:26 PM
Contributor
Posts: 66

Re: Conditionally Email

Hi All,

 

I have found a way to do this, i have checked for the existence of the file and have created the macro variables as shown in my below post. and have created a datasetset to read the status of the existence of the file and send the email using ODS/ or export the dataset to external file and send it as an attachement.

 

 

Thanks....

 

 

View solution in original post


All Replies
Solution
‎02-06-2017 07:26 PM
Contributor
Posts: 66

Re: Conditionally Email

Hi All,

 

I have found a way to do this, i have checked for the existence of the file and have created the macro variables as shown in my below post. and have created a datasetset to read the status of the existence of the file and send the email using ODS/ or export the dataset to external file and send it as an attachement.

 

 

Thanks....

 

 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 125 views
  • 0 likes
  • 1 in conversation