The Get samples for the CICS environment on z/OS

Special considerations for the Get samples for the CICS environment.

The transactions take the following parameters in an EXEC PARM, separated by commas:
  1. The number of messages to get (up to four digits)
  2. The browse/get message option (one character: B to browse or D to destructively get the messages)
  3. The syncpoint control (one character: S for syncpoint or N for no syncpoint)
  4. The name of the target queue (48 characters)

If you enter any of these parameters incorrectly, you receive appropriate error messages.

For the COBOL sample, invoke the Get sample in the CICS environment by entering:
MVGT,9999,B,S,QUEUE.NAME
For the C sample, invoke the Get sample in the CICS environment by entering:
MCGT,9999,B,S,QUEUE.NAME

When the messages are retrieved from the queue, they are put on a CICS temporary storage queue with the same name as the CICS transaction (for example, MCGT for the C sample).

Here is example output of the Get samples:
**************************** TOP OF QUEUE ************************
000000000 : 000000010: **********
000000001 : 000000010 :**********
*************************** BOTTOM OF QUEUE **********************


Usage notes

  • To keep the samples simple, there are some minor functional differences between language versions. None of the differences relate to the MQI.
  • If you enter a queue name that is longer than 48 characters, its length is truncated to the maximum of 48 characters but no error message is returned.
  • Before entering the transaction, press the CLEAR key.
  • CSQ4CCJ1 can only correctly display character messages because it only displays until the first NULL (\0) character is displayed.
  • For the numeric field, enter any number in the range 1 through 9999. The value that you enter should be a positive number. For example, to get a single message, we can enter the value 1, 01, 001, or 0001. If you enter a nonnumeric or negative value, you might receive an error.
  • Messages longer than 24 526 bytes in C and 9 950 bytes in COBOL are truncated. This is due to the way that the CICS temporary storage queues are used.
  • For both programs, CSQ4CCK1 and CSQ4CVK1, enter B in the get parameter if we want to browse the messages, otherwise enter D. This performs destructive MQGET calls. If you enter any other value you receive an error message.
  • For both programs, CSQ4CCJ1 and CSQ4CVJ1, enter S in the syncpoint parameter to retrieve messages in syncpoint. If you enter N in the syncpoint parameter, the MQGET calls are issued out of syncpoint. If you enter any other value you receive an error message.

Parent topic: The Get samples on z/OS