z/OS TSO/E REXX User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Interpreting Error Messages

z/OS TSO/E REXX User's Guide
SA32-0982-00

When you run an exec that contains an error, an error message often displays the line on which the error occurred and gives an explanation of the error. Error messages can result from syntax errors and from computational errors. For example, the following exec has a syntax error.

Example of an Exec with a Syntax Error

/************************** REXX ***********************************/
/* This is an interactive REXX exec that asks the user for a       */
/* name and then greets the user with the name supplied.  It       */
/* contains a deliberate error.                                    */
/*******************************************************************/

SAY "Hello! What's your name?"
PULL who                       /* Get the person's name.
IF who = '' THEN
   SAY 'Hello stranger'
ELSE
   SAY 'Hello' who
When the exec runs, you see the following on your screen:
  Hello! What's your name?
      7 +++ PULL who                    /* Get the person's name.IF who =
'' THEN SAY 'Hello stranger'ELSE   SAY 'Hello' who
IRX0006I Error running REXX.EXEC(HELLO), line 7: Unmatched "/*" or quote
***

The exec runs until it detects the error, a missing */ at the end of the comment. As a result, the SAY instruction displays the question, but doesn't wait for your response because the next line of the exec contains the syntax error. The exec ends and the language processor displays error messages.

The first error message begins with the line number of the statement where the error was detected, followed by three pluses (+++) and the contents of the statement.
      7 +++ PULL who                    /* Get the person's name.IF who =
'' THEN SAY 'Hello stranger'ELSE   SAY 'Hello' who
The second error message begins with the message number followed by a message containing the exec name, line where the error was found, and an explanation of the error.
IRX0006I Error running REXX.EXEC(HELLO), line 7: Unmatched "/*" or quote

For more information about the error, you can go to the message explanations in z/OS TSO/E Messages, where information is arranged by message number.

To fix the syntax error in this exec, add */ to the end of the comment on line 7.
 PULL who                       /* Get the person's name.*/

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014