Agency-query program (CSQ4CVB5/CSQ4CCB5) on z/OS

The agency-query program is supplied as both a COBOL program and a C program. Both programs have the same design. This shows that programs of different types can easily coexist within an IBM MQ application, and that the program modules that make up such an application can easily be replaced.

An instance of the program is started by a trigger event on any of these queues:

  • For the COBOL program (CSQ4CVB5):

    • CSQ4SAMP.B5.MESSAGES
    • CSQ4SAMP.B6.MESSAGES
    • CSQ4SAMP.B7.MESSAGES

  • For the C program (CSQ4CCB5), queue CSQ4SAMP.B8.MESSAGES

Note: To use the C program, we must alter the definition of the namelist CSQ4SAMP.B4.NAMELIST to replace the queue CSQ4SAMP.B7.MESSAGES with CSQ4SAMP.B8.MESSAGES. To do this, we can use any one of:

After it has opened the appropriate queue, this program gets a message from the queue using the MQGET call with the wait option, and with the wait interval set to 30 seconds.

The program simulates the search of an agency's database by searching the VSAM data set CSQ4BAQ for the account number that was passed in the loan request message. It then builds a reply that includes the name of the queue that it is serving and a creditworthiness index. To simplify the processing, the creditworthiness index is selected at random.

When putting the reply message, the program uses the MQPUT1 call and:

  • Copies the CorrelId of the loan request message
  • Uses the MQPMO_PASS_IDENTITY_CONTEXT option

The program sends the reply message to the reply-to queue named in the loan request message. (The name of the queue manager that owns the reply-to queue is also specified in the loan request message.) Parent topic: Design of the Credit Check sample on z/OS