BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PaulNeag
Calcite | Level 5

I am using EG7.1

I sometimes conditionnaly throw custom errors in my programs by using:

%PUT ERROR: CUSTOM ERROR THROWN BY MACRO;

or alternatively:

DATA _NULL_;
ERROR "ERROR:CUSTOM ERROR THROWN BY DATASTEP";
RUN;

I would expect these errors to appear in the log summary just like normal errors do.

They will show up in the log and a red "X" will show in the program icon but they do not show up in the error list.

 

Is there anyway to enable them showing in the list ? Perhaps a macro flag that needs to be set ?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
CaseySmith
SAS Employee

Prior to EG 7.11, the log summary view did not find errors in the log if there wasn't a space immediately after "ERROR:".  So, to workaround, make sure you put a space between "ERROR:" and your error message.  This was fixed in EG 7.11, which recognizes errors with or without a space after "ERROR:".

 

Casey

 

ps- Fortunately, almost all SAS-generated errors start with "ERROR: " (with a space), so really only an issue for user-written errors.


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

View solution in original post

4 REPLIES 4
Quentin
Super User

Odd.  It works they way you want in EG 6.1.  User-written error messages are highlighted and show up in the log summary.

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
Quentin
Super User

Sorry, I was wrong. I didn't actually run the OP posted. 

 

@CaseySmith is correct. When I run:

DATA _NULL_;
ERROR "ERROR:CUSTOM ERROR not found by Log Summary";
ERROR "ERROR: CUSTOM ERROR found by Log Summary";
RUN;

In EG 6.1, only the second error message with the space after the colon is caught in the log summary.

 

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
CaseySmith
SAS Employee

Prior to EG 7.11, the log summary view did not find errors in the log if there wasn't a space immediately after "ERROR:".  So, to workaround, make sure you put a space between "ERROR:" and your error message.  This was fixed in EG 7.11, which recognizes errors with or without a space after "ERROR:".

 

Casey

 

ps- Fortunately, almost all SAS-generated errors start with "ERROR: " (with a space), so really only an issue for user-written errors.


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

PaulNeag
Calcite | Level 5
Thank you very much !

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
  • 4 replies
  • 2211 views
  • 1 like
  • 3 in conversation