Determine if a request-processor exists

You can determine if a job has a request processor by displaying the job's call stack.

Use either option 11 on the Display Job (DSPJOB) or Work with Job (WRKJOB) command, or select option 10 for the job listed on the WRKACTJOB display. If a number is shown in the request level column on the display of the job's call stack, the program or ILE procedure associated with the number is a request-processor. In the following example, both QCMD and QTEVIREF are request processors:

                           Display Call Stack
                                                            
System:   S0000000
Job:   WS31           User:   QSECOFR        Number:   000173
 
Type options, press Enter.
  5=Display details
 
     Request   Program or
Opt   Level    Procedure      Library        Statement      Instruction
               QCMD           QSYS                             01DC
       1       QCMD           QSYS                             016B
               QTECADTR       QSYS                             0001
       2       QTEVIREF       QSYS                             02BA
 
 
 
 
 
 
 
                                                            
            Bottom
 
F3=Exit   F10=Update stack   F11=Display activation group   F12=Cancel
F17=Top   F18=Bottom
 

The following is an example of a request-processing procedure:

PGM
    SNDPGMMSG  MSG('Request Message') TOPGMQ(*EXT) MSGTYPE(*RQS)
    RCVMSG     PGMQ(*EXT) MSGTYPE(*RQS) RMV(*NO)
      .
      .
      .
    CALL   PGM(PGMONE)
    MONMSG MSGID(CPF1907)
      .
      .
      .
    RMVMSG CLEAR(*ALL)
    CALL   PGM(PGMTWO)
      .
      .
      .
ENDPGM

The first two commands in the procedure make it a request processor. The procedure remains a request processor until the Remove Message (RMVMSG) command is run. A Monitor Message command is placed after the call to program PGMONE because an end request may be sent from PGMONE to the request-processor. If monitoring is not used, a function check would occur for an end request. No message monitor is specified after the call to PGMTWO because the Remove Message (RMVMSG) command ends request processing.

If an end request is attempted when no request-processing procedure or program is called, an error message is issued and the end operation is not performed.

Note: In the sample programs, the Receive Message (RCVMSG) command uses the minimal number of parameters needed to become a request processor. You need to say you want to receive a request message but do not want to remove it. You also need to identify the specific call queue from which the message request originated. Other parameters can be added as necessary.