To link to another program that has been defined to CICS(R), a CICS application can issue a command like this:
EXEC CICS LINK PROGRAM(name) COMMAREA(data-area)
For the complete syntax of this command, see the CICS Application Programming Reference.
If you want a WebSphere MQ application to run a CICS application that invokes a CICS DPL program, the WebSphere MQ application must send a structured message to the bridge request queue. In the simplest case, the message data consists only of the name of a DPL program to be run. Follow this by COMMAREA data if you want to make data available to the DPL program when it starts.
If you want to run more than one DPL program within a unit of work, or you prefer a specific transaction code (overwriting the default CKBP), or you require certain levels of authorization to run the DPL program, you must supply information in an MQCIH. The MQCIH must precede the program name and any COMMAREA data that you send.
These examples show the different structures that you can use for messages that run DPL programs through the bridge.
*------*----------*
| MQMD | ProgName |
*------*----------*
The program specified by ProgName is invoked by CICS as a DPL program.*------*----------*--------------* | MQMD | ProgName | CommareaData | *------*----------*--------------*
*------*-------*----------*
| MQMD | MQCIH | ProgName |
*------*-------*----------*
*------*-------*----------*--------------* | MQMD | MQCIH | ProgName | CommareaData | *------*-------*----------*--------------*
If a bridge task running a DPL program ends abnormally, it returns a message to the reply queue with the following structure, whether or not the inbound message preceding the failure contains an MQCIH:
*------*-------*---------------*
| MQMD | MQCIH | CSQC* message |
*------*-------*---------------*
CSQC* messagerepresents an error message that indicates the error type. The value of field MQCIH.Format is set to MQFMT_STRING, so that the message can be properly converted if the final destination uses a different CCSID and encoding. The MQCIH also contains other fields that you can use to diagnose the problem.
Optionally, additional headers with format names beginning MQH, and containing standard link fields, can precede the MQCIH header. Such headers are returned unmodified in the output message because the bridge makes no use of data within the headers
This C-language code fragment shows how you can construct a message buffer when you want to invoke a DPL program with COMMAREA data, and include a WebSphere MQ CICS Information Header (MQCIH).
/* #defines */ #define PGMNAME "DPLPGM" /* DPL program name */ #define PGMNAMELEN 8 #define CALEN 100 /* Commarea length */The DPL program that is invoked must conform to the DPL subset rules
·
·
·
/* Data declarations */ MQMD mqmd ; /* Message descriptor */ MQCIH mqcih ; /* CICS information header */ MQCHAR * Commarea ; /* Commarea pointer */ MQCHAR * MsgBuffer ; /* Message buffer pointer */
·
·
·
/* allocate storage for the buffers */ Commarea = malloc(CALEN * sizeof(MQCHAR)) ; MsgBuffer = malloc(sizeof(MQCIH) + PGMNAMELEN + CALEN) ;
·
·
·
/* Initialize commarea with data */
·
·
·
/* Initialize fields in the MQMD as required, including: */ memcpy(mqmd.MsgId, MQMI_NONE, sizeof(mqmd.MsgId)) ; memcpy(mqmd.CorrelId, MQCI_NEW_SESSION, sizeof(mqmd.CorrelId)) ; /* Initialize fields in the MQCIH as required */
·
·
·
/* Copy the MQCIH to the start of the message buffer */ memcpy(MsgBuffer, &mqcih, sizeof(MQCIH)) ; /* Set 8 bytes after the MQCIH to spaces */ memset(MsgBuffer + sizeof(MQCIH), ' ', PGMNAMELEN) ; /* Append the program name to the MQCIH. If it is less than */ /* 8 characters, it is now padded to the right with spaces. */ memcpy(MsgBuffer + sizeof(MQCIH), PGMNAME, PGMNAMELEN) ; /* Append the commarea after the program name */ memcpy(MsgBuffer + sizeof(MQCIH) + PGMNAMELEN, &Commarea CALEN ) ; /* The message buffer is now ready for the MQPUT */ /* to the Bridge Request Queue. */
·
·
·
. See the CICS Application Programming Guide for further details.
Notices |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
csq036i |