Command interface return codes

Return codes for the command interface are the same regardless of the language of your application. The return code can be positive or zero. A value of zero indicates successful execution. A positive value indicates that the execution failed or was in some way abnormal.

Return codes appear in a variable in the user's EXEC or CLIST. If you run a REXX EXEC, the return code is in the REXX variable called RC; if you run a CLIST, the return code is in the CLIST variable &LASTCC.

The following example shows an EXEC that examines a return code.

Example

Your application contains the following code:

ADDRESS ISPEXEC SELECT PGM(DSQCCI) PARM(RUN QUERYA (FORM=FORMA))
Select
  When (RC = 0)  Then nop
  When (RC = 64) Then
      Say "You must run QMF with ISPF to use command interface."
  When (RC = 100) Then
      Say "You need to start QMF before you begin your application"
  Otherwise
      Say "Unexpected error ("RC") from QMF command interface."
End

The code runs a query and then tests for an error using REXX RC.

You can place code for handling errors in program modules as well as in EXECs or CLISTs.

[ Previous Page | Next Page | Contents | Index ]