Hey guys!
I'll try my best to explain my current problem, maybe someone has any idea on how to approach this:
To make it short, I will call SAS Enterprise Guide 8.3 "SAS EG" and SAS Visual Analytics 7.4 "SAS VA".
Current data flow:
Problem:
Approach:
Does anyone has any idea on how to solve this?
Thank you very much!
Since report distribution is based on time rather than event, one idea you could have is to distribute the report through SAS by email. All you'll need is the link to the report. Visual Analytics 7.4 links can be easily obtained by going to the menu, selecting "Email," and copying the link. In Visual Analytics 7.5 and later, it's under "Copy Link."
The only downside to this method is that you cannot include a pdf attachment, but you can at least alert people that new valid data has been added to the report.
To send an email through SAS, use the email filename access method. We'll call the email code to run only when all rows are populated.
/* Email configuration */
%let to = email_list@company.com; *Space-separate additional email addresses;
%let from = no-reply@company.com;
%let report = %nrstr(REPORT LINK HERE);
/* Check number of missing rows for a column */
proc sql noprint;
select nmiss(column)
into :nmiss
from have
;
quit;
/* Only send an email if column is not missing */
%macro sendEmail;
%if(&nmiss. LE 0) %then %do;
filename mailbox email
to = ("&to.")
from = "&from."
subject = "Report data has been updated"
;
data _null_;
file mailbox;
put "New data has been added to the report.";
put "Report URL: %superq(report)";
run;
%end;
%mend;
%sendEmail;
As a side note, if you go to SAS Viya, you can pull images of a report through the Viya REST API.
Since report distribution is based on time rather than event, one idea you could have is to distribute the report through SAS by email. All you'll need is the link to the report. Visual Analytics 7.4 links can be easily obtained by going to the menu, selecting "Email," and copying the link. In Visual Analytics 7.5 and later, it's under "Copy Link."
The only downside to this method is that you cannot include a pdf attachment, but you can at least alert people that new valid data has been added to the report.
To send an email through SAS, use the email filename access method. We'll call the email code to run only when all rows are populated.
/* Email configuration */
%let to = email_list@company.com; *Space-separate additional email addresses;
%let from = no-reply@company.com;
%let report = %nrstr(REPORT LINK HERE);
/* Check number of missing rows for a column */
proc sql noprint;
select nmiss(column)
into :nmiss
from have
;
quit;
/* Only send an email if column is not missing */
%macro sendEmail;
%if(&nmiss. LE 0) %then %do;
filename mailbox email
to = ("&to.")
from = "&from."
subject = "Report data has been updated"
;
data _null_;
file mailbox;
put "New data has been added to the report.";
put "Report URL: %superq(report)";
run;
%end;
%mend;
%sendEmail;
As a side note, if you go to SAS Viya, you can pull images of a report through the Viya REST API.
It seems to me that you are using EG to regularly prepare and load data into SAS VA. How often are you doing this? Daily, weekly or some other interval?
We have a similar setup to you. EG 8.3 and SAS VA 7.5. We have daily and monthly jobs updating SAS VA. However we use SAS Management Console to schedule and run those regular jobs rather than using EG. Is there any reason why you don't have access to SMC? It's a far better and more reliable tool for running regular SAS jobs as all of the processing is server-based and not reliant on a PC.
Also there's no problem sending conditional emails as part of the data preparation as explained by @Stu_SAS .
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.