Help using Base SAS procedures

How to Create Alerts on any condition in SAS?

Reply
Contributor
Posts: 20

How to Create Alerts on any condition in SAS?

Hi

I have a task of creating Alerts upon certain condition.

Task-Provide an alert for any card with $10000 or more in cash loads in 30 days.

Can anyone please tell how to create Alerts in SAS

Waiting for your replies!!!

Thanks

Sarvendra

Super Contributor
Posts: 578

Re: How to Create Alerts on any condition in SAS?

Posted in reply to Sarvendra

The process we use requires you to:

  1. code a query that identifies the conditions for which you want to send an alert
  2. wrap the code in a macro that generates an email if there are records found
  3. use SAS Managment Console to schedule the job at whatever interval you need
SAS Employee
Posts: 10

Re: How to Create Alerts on any condition in SAS?

That'll do it nicely!

Contributor
Posts: 20

Re: How to Create Alerts on any condition in SAS?

Thanks a lot Bailey for the reply.but can you please elaborate step 2 and 3.how email can be genrated inside a maco and

how job can be scheduled using SAS console..can u give any detailed document link as i dont have much exp in SAS management console

Thanks

Super Contributor
Posts: 578

Re: How to Create Alerts on any condition in SAS?

Posted in reply to Sarvendra

unfortunately, the scheduling is site specific.

As for the email in a macro...

%macro tst();

all of your code...

proc sql noprint;

select count(*)

into :recs

from work.final_output;

quit;

%if &recs ne 0 %then %do;

     filename mailit email;

     data _null_;

    file mailit

     to=('emailaddress')

     from=('from email address')

     sender='Sender'

     Subject="subject"

     ;

    Line1= 'email text line 1';

    Line2= 'email text line 2';

    Line3 = "Syscc = &syscc";

    put Line1;

    put Line2;

    put Line3;

    put ;

    put ;

    put "This email address is not monitored for replies.";

    put ;

    run;

%end;

Contributor
Posts: 20

Re: How to Create Alerts on any condition in SAS?

Much Thanks  Bailey Smiley Happy

But I did not get the line "unfortunately, the scheduling is site specific."..what does it mean?

Super Contributor
Posts: 578

Re: How to Create Alerts on any condition in SAS?

Posted in reply to Sarvendra

it means that you should talk to your site administrator or SAS support for more details.

Super User
Posts: 3,252

Re: How to Create Alerts on any condition in SAS?

To provide a little bit more detail on scheduling...you can only schedule from SAS Management Console if the SAS LSF scheduler is installed as part of your SAS Server installation.

You need to find out what scheduling facilities you have available to you before we can offer further advice - as per DBailey.

Ask a Question
Discussion stats
  • 7 replies
  • 464 views
  • 0 likes
  • 4 in conversation