The top 10 errors, notes and warnings that prompt DATA step programmers to call SAS Technical Support

This post was kindly contributed by Key Happenings at support.sas.com - go there to comment and to read the full post.

Contributed by Kim Wilson, SAS Technical Support

As a DATA step programmer, you know the sigh of relief that comes when your job finishes and your SAS log is clear of any errors or warnings. When these messages do occur, most of the time they are intuitive enough so that you can move directly to the offending code, make the necessary changes, and complete the job successfully. However, what do you do about those perplexing messages that sometimes appear, making you scratch your head in puzzlement?

Here are the top 10 errors, notes and warnings that prompt DATA step programmers to call SAS Technical Support:

  1. ERROR: AN INTERNAL ERROR HAS OCCURRED WHILE READING A COMPRESSED FILE. PLEASE CALL YOUR SAS SITE REPRESENTATIVE AND REPORT THE FOLLOWING…
    This normally indicates the data set is damaged. Run PROC DATASETS with the REPAIR statement to see if it can be repaired. If not, pull from backup or recreate the data set.

  2. ERROR: ARRAY SUBSCRIPT OUT OF RANGE AT LINE N AND COLUMN N
    This indicates a reference was made to a nonexistent variable. Often a DO loop has been used to point to array variables so check the upper and lower boundaries. A dump of variable values at the time of the error appears in the log so use that information along with the line number of the offending line of code that is output in the error message.

  3. ERROR: THE FORMAT $NAME WAS NOT FOUND OR COULD NOT BE LOADED
    This occurs when you attempt to format a character variable with a numeric format. If you choose to convert the character variable to numeric, use the INPUT function along with the appropriate numeric informat and then the numeric format will work properly. This message is also output if a custom format is referenced but is unknown to SAS. A LIBNAME statement should be issued with the location of the format catalog.

  4. NOTE: THE MEANING OF AN IDENTIFIER AFTER A QUOTED STRING MAY CHANGE IN A FUTURE SAS RELEASE. INSERTING WHITE SPACE BETWEEN A QUOTED STRING AND THE SUCCEEDING IDENTIFIER IS RECOMMENDED.
    Beginning in SAS 9, this note indicates an alphabetic character immediately follows a quoted string. A space must be inserted after the closing quote since SAS assumes this is a constant.

  5. NOTE: INVALID ARGUMENT TO FUNCTION INPUT AT LINE N COLUMN N
    Be sure to use the correct informat along with the INPUT function when converting character variable to a numeric variable. If you know you are using the correct informat but have a few invalid data values, use the ?? modifier prior to the informat so SAS doesn’t output the note when an invalid value is read. When you’re unsure the value inside a variable, write it to the log with a PUT statement and the $HEXw. format.

  6. NOTE: MERGE STATEMENT HAS MORE THAN ONE DATA SET WITH REPEATS OF BY VALUES
    When SAS merges data sets and more than one of them has duplicate observations for the same BY value, this courtesy note is issued to alert you of possible unexpected results. The values from the last data set listed on the MERGE statement are not always the values shown in the output data set. This depends on duplicates of the BY value(s).

  7. NOTE: SAS WENT TO A NEW LINE WHEN INPUT STATEMENT REACHED PAST THE END OF A LINE
    The FLOWOVER option in in effect unless TRUNCOVER or MISSOVER are specified on the INFILE statement. Normally TRUNCOVER is the preferred setting so that the values read from the file are output to the data set.

  8. NOTE: INVALID DATA FOR VARIABLE-NAME AT LINE N
    This can occur when attempting to read a character value with a numeric informat, the informat specified doesn’t match the data, reading past the intended columns of data, reading embedded unprintable characters, reading a Unicode file, as well as others scenarios.

  9. WARNING: THE QUOTED STRING CURRENTLY BEING PROCESSED HAS BECOME MORE THAN 262 CHARACTERS LONG. YOU MAY HAVE UNBALANCED QUOTATION MARKS.
    When a quoted string exceeds 262 characters in length, this warning is issued. Beginning in SAS 9, the NOQUOTELENMAX system option can suppress the warning.

  10. WARNING: MULTIPLE LENGTHS WERE SPECIFIED FOR THE VARAIBLE VARIABLE-NAME BY INPUT DATA SET(S). THIS MAY CAUSE TRUNCATION OF DATA.
    When a LENGTH statement shortening the length of a variable preceeds a SET, MERGE, UPDATE, or MODIFY statement, this warning results. Beginning in SAS 9.2, you can control the type of message that is written to the log by specifying the VARLENCHK system option. This warning excludes BY variables.

The errors, notes and warnings that are discussed in this post have been the subject of many calls to SAS Tech Support from SAS customers over the past few years. Hopefully, presenting the discussion about them in one document can serve as a resource to you as you continue using the DATA step.

For more indepth information about these errors, read The Top 10 Head-Scratchers: SAS® Log Messages That Prompt a Call to SAS Technical Support.

This post was kindly contributed by Key Happenings at support.sas.com - go there to comment and to read the full post.