Application programming for the CICS DPL bridge
This C-language code fragment shows how we 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 */ ⋮ /* 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. */ ⋮The DPL program that is invoked must conform to the DPL subset rules. See the CICS Application Programming Guide for further details.
Parent topic:
Using CICS DPL programs with the bridge
fg15450_