Desktop productivity for business analysts and programmers

Custom errors don't appear in log summary

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Custom errors don't appear in log summary

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


Accepted Solutions
Solution
‎05-20-2016 02:49 PM
SAS Super FREQ
Posts: 274

Re: Custom errors don't appear in log summary

[ Edited ]

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.

View solution in original post


All Replies
Trusted Advisor
Posts: 1,216

Re: Custom errors don't appear in log summary

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

Trusted Advisor
Posts: 1,216

Re: Custom errors don't appear in log summary

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

 

@CaseyS_SAS 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.

 

Solution
‎05-20-2016 02:49 PM
SAS Super FREQ
Posts: 274

Re: Custom errors don't appear in log summary

[ Edited ]

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.

New Contributor
Posts: 3

Re: Custom errors don't appear in log summary

Thank you very much !
☑ This topic is SOLVED.

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

Discussion stats
  • 4 replies
  • 365 views
  • 1 like
  • 3 in conversation