BookmarkSubscribeRSS Feed

Currently, just a few options (they don't all appear when running proc options group=  errorhandling; ) allow to decide how message are displayed in the LOG (I am not too sure what the last 2 do...), like:

 

MERROR            
Issues a warning message for an unresolved macro reference.

SERROR            
Issues a warning message when a macro variable reference does not match a macro variable.

VALIDFMTNAME
Specifies the maximum size that user-created formats and informat names can be before an error or warning is issued.

BYERR             
SAS issues an error message and stops processing if the SORT procedure attempts to sort a _NULL_ data set.

DKRICOND   
Specifies the error level to report when a variable is missing from an input data set during the processing of a DROP=, KEEP=, or RENAME= data set option.

DKROCOND
Specifies the error level to report when a variable is missing from an output data set during the processing of a DROP=, KEEP=, or RENAME= data set option.

DSNFERR
Issues an error message and stops processing when a SAS data set cannot be found.

MERGENOBY
Specifies the type of message that is issued when MERGE processing occurs without an associated BY statement.

VARINITCHK
Specifies the type of message to write to the SAS log when a variable is not initialized.

VARLENCHK
Specifies the type of message to write to the SAS log when the length of the variable that is being read is longer than the length that is defined for the variable.
 
DS2SCOND
Specifies the type of message that PROC DS2 generates.

RSASIOTRANSERROR  
Displays a transcoding error when illegal values are read from a remote application.

VNFERR            
SAS issues an error message when a BY variable exists in one data set but not another when the other data set is _NULL_.

 

We need more ways to customise how messages are displayed in the LOG when some events are flagged.

 

Some of the messages we don't consider worthy of a warning (some flag something that can't even be fixed!) include:

 

WARNING: The intervals on the axis labeled XXX are not evenly spaced
WARNING: The enhanced date axis procedure has failed
WARNING: Compression was disabled for data set
WARNING: FOOTNOTE...
WARNING: TITLE...

 

They give us a hard time for monitoring automated production jobs.

 

On the contrary notes like these should be show-stoppers:

 

NOTE: MERGE statement has more than one data set
NOTE: Library  XXX does not exist.
NOTE: SAS went to a new line
NOTE: DATA STEP stopped due...
 

It would be nice to be able to raise valid alarms and avoid false alarms by setting the type of message for the various messages that SAS produces.

8 Comments
ChrisNZ
Tourmaline | Level 20

[Deleted as I could finally edit the entry and hopefully remove any confusion]

ballardw
Super User

I am not sure what you mean by a "false alarm"?

I consider a few are annoying because I know that I'm going to generate them such as the "text has exceeded xxx characters" when using ODS Text but if I'm not generating lots of text then that is a helpful warning.

ChrisNZ
Tourmaline | Level 20

@ballardw The production jobs are monitored and any warning (or error) is disallowed (these rules are not ours).

 

So for example

WARNING: Compression was disabled for data set

will mark the job in red, and will make it appear in monthly statistics, when we don't care.

 

RobP
Quartz | Level 8

Yeah dealing with default error handling in SAS is horrible... Sometimes it lists things as ERRORs that you don't care about.  Other times it lists things as NOTEs that should be showstoppers.  Here's a snippet of what we're forced to do to identify whether or not jobs ran successfully (and to enforce some sensible coding practices in our production environment):

 

    if 
    (
        line  =: cats("E","RROR:")
    or  line  =: cats("W","ARNING:")
    or  line  =: cats("N","OTE: The query requires remerging summary statistics back with the original data")
    or  line  =: cats("N","OTE: Numeric values have been converted to character values")
    or  line  =: cats("N","OTE: Character values have been converted to numeric values")
    or  line  =: cats("N","OTE: Missing values were generated as a result of performing an operation on missing values")
    or  line  =: cats("N","OTE: MERGE statement has more than one data set with repeats of BY values")
    or  line  =: cats("I","NFO: Character variables have defaulted to a length of 200")
    or  line  =: cats("N","OTE: Invalid")
    or  line  =: cats("N","OTE: Division by zero detected")
    or  line  =: cats("N","OTE: A CASE expression has no ELSE clause.")
    or  line  =: cats("N","OTE: Variable") and index(line,"is uninitialized.")  
    or  line  =: cats('N','OTE: The "<>" operator is interpreted as "MAX"')
    or  line  =: 'tml: permission denied'
    or  line  =: cats("N","etwork error: Connection timed out")
    or  line  =: cats("N","OTE: The SAS System stopped processing this step because of errors.") 
    )
    and not
    (
        line =: cats("W","ARNING: Your system is scheduled to expire")
    or  line =: cats("W","ARNING: The Base Product product with which Session Manager is associated")
    or  line =: cats("W","ARNING: will be expiring soon, and is currently in warning mode to indicate")
    or  line =: cats("W","ARNING: this upcoming expiration. Please run PROC SETINIT to obtain more")
    or  line =: cats("W","ARNING: information on your warning period.")
    or  line =: cats("W","ARNING: The Base SAS Software product with which ")
    or  line =: cats("W","ARNING: This CREATE TABLE statement recursively references the target table. A consequence")
    or  line =: cats("W","ARNING: Unable to copy SASUSER registry to WORK registry. Because of this, you will not see registry customizations during this")
    or  line =: cats("W","ARNING: Estimates did not improve after a ridge was encountered in the objective function.")
    or  line =: cats("W","ARNING: Estimates may not have converged.")
    or  line =: cats("W","ARNING: The model defined by the new estimates is unstable. The iteration process has been")
    or  line =: cats("W","ARNING: More values of input variable")
    or  line =: cats("W","ARNING: The Base SAS Software product with which DATASTEP is associated will be expiring soon") 
    or  line =: cats("W","ARNING: Your system is scheduled to expire on")
    or  line =: cats("W","ARNING: The Marquardt direction")
    or  line =: cats("W","ARNING: The SAS/ETS product with which ARIMA is associated will be expiring soon")
    or  line =: cats("W","ARNING: The SAS/ETS product with which EXPAND is associated will be expiring soon")
    or  line =: cats("W","ARNING: REGION placement exceeds available space for PDF destination")

    or  line =: cats("E","RROR: A lock is not available for")
    or  line =: cats("E","RROR: Lock held by process")
    or  line =: cats("E","RROR: Errors printed on page")
    or  line =: cats("E",'RROR: Execution canceled by an %ABORT CANCEL statement.')
    or  line =: cats("E","RROR: The estimation algorithm did not converge")
    or  line =: cats("E","RROR: Forecasting was not performed because estimation was not done.")
    or  (line =: cats("W","ARNING: Function ") and index(line, "was defined in a previous package.") )


    )
    then do;
PaigeMiller
Diamond | Level 26

Please explain the benefit of 

 

line  =: cats("E","RROR:")

instead of 

line  =: "ERROR:"

 

ChrisNZ
Tourmaline | Level 20

@PaigeMiller if you search for the word ERROR, the program lines are not found. Only the actual printed messages.

ChrisNZ
Tourmaline | Level 20

@RobP

This line is incorrect, there should be parentheses.

or  line  =: cats("N","OTE: Variable") and index(line,"is uninitialized.")     

.

jonas_olsson
Calcite | Level 5

As mentioned in question How to suppress notes in the SAS log of type "connected using session" and "processed the request"?  it would be great to also have options to specifically suppress notes like these:

 

NOTE: The UUID '9c7282ec-f599-444f-8cc2-e01054aab92f' is connected using session MYSESS.
NOTE: The Cloud Analytic Services server processed the request in 0.000225 seconds.
NOTE: The UUID '9c7282ec-f599-444f-8cc2-e01054aab92f' is connected using session MYSESS.
NOTE: The Cloud Analytic Services server processed the request in 0.00078 seconds.