Example: Invoking CEMT I TASK from an application

 

This example shows how an application can start a transaction, in this case CEMT, that expects to receive command line arguments when it is invoked.

When the CEMT task starts, it issues EXEC CICS RECEIVE to receive any command line arguments that follow its identifier. The application that emulates the command line invocation must therefore start CEMT with a RECEIVE vector that contains appropriate values in the vector structure, and also include the command line values.

The following C-language code fragment shows how the inbound message can be constructed. Note that dfhbrmqh.h is in the CICS SAMPLIB.

/* #includes                                                 */
#include cmqc.h                 /* WebSphere MQ header       */
#include dfhbrmqh.h             /* Vector structures         */
⋮
/* #defines                                                  */
#define CMDSTRING   "CEMT I TASK"          /* Command string */
#define RCV_VECTOR  "0402"             /* Vector descriptor  */
#define INBOUND     "I   "             /* Inbound type       */
#define VERSION     "0000"             /* Vector version     */
#define YES         "Y   "             /* YES indicator      */
#define NO          "N   "             /* NO indicator       */
⋮
/* Data declarations                                         */
/* AID indicator value                                       */
const char          AID[ 4 ] = { 0x7d, ' ',' ',' ' } ;
MQMD         mqmd ;             /* Message descriptor        */
MQCIH mqcih = {MQCIH_DEFAULT} ; /* CICS information header   */
brmq_vector_header  brvh  ;     /* Standard vector header    */
brmq_receive        brrcv ;     /* RECEIVE vector structure  */
MQCHAR            * MsgBuffer ; /* Message buffer pointer    */
⋮
The outbound message that is returned to the reply queue contains a SEND reply vector with data in terminal control format; your application needs to know this when it analyzes the data that it receives.

 

Parent topic:

Application programming for the CICS 3270 bridge


fg15580_