BookmarkSubscribeRSS Feed
rbatra
Calcite | Level 5

 

I am working on SAS Enterprise 4.3

I have various programs on a project , my requirement is that as soon as there is an error in any of the program , then the sas processing is stopped and i need to capture the error and mail it to the user who is running the project.

 

I would also like to share my thoughts regarding solutions:

a) use options errorabend , but this disconnects the user from the server and log is also lost , for which i saved log at a particular location and was able to scan for error and error message but since user is disconnected  he/she will have to connect and run that code which is not feasible.

 

b) creating three macros:

1) if &syserr > 0 then %put : &syserrtxt

2) create a macro for mail-successful and unsucessful run as per syserr

3) abort program again as per &syserr

 

Issue with the above aproach is that my codes in individual programs are huge and will have to call this macro again and again in between the codes.

 

 

c) I am not sure if i can sue conditional processing , if yes then How?

 

Thanks

2 REPLIES 2
SASKiwi
PROC Star

The type of control you want over your SAS applications would be much better handled if you converted your EG project to run as a SAS batch job. ERRORABEND works with no problem in batch, logs are kept automatically and if you use the server-based schedulers available via SAS Management Console then emailing happens automatically too.

 

If your project is a business-critical process then you should seriously consider server-based scheduling and batch processing for your production jobs - in my view this would be best practice. PCs are just not reliable enough. Use EG for development and testing only.

Kurt_Bremser
Super User

Concur with @SASKiwi. Once you reach that level of process complexity, using a solid scheduler to run your programs in batch, and using the scheduler's capabilities to detect correct and incorrect batch runs, is a must.

Check which scheduling software is used in your organisation, and have your SAS server integrated there.

Everything else is just a form of slow and painful suicide.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2 replies
  • 1572 views
  • 0 likes
  • 3 in conversation