Translated code for CICS API commands

Application programs contain CICS® API commands and are written in COBOL, C, C++, or PL/I. For COBOL, C, and C++, the CICS translator takes the programs and creates an equivalent source program where each command is translated into a call statement that is in the language of the original source program.

This equivalent source program is compiled and the resulting object program is executed in a CICS environment.

The translator-generated call statements form the runtime interface between the application program and CICS.

Translator restrictions
Avoid the use of EXEC, CICS, END-EXEC, or names that start with CICS, cics, DFH, EFH, or FAA, as names for user variables.
For COBOL

For a COBOL application program, each command is replaced by one or more MOVE and SET statements, followed by a COBOL CALL statement, followed by an IF statement.

The purpose of the MOVE and SET statements is to encode the information that is in the command into the CICS internal format. For example, a command such as:
 EXEC CICS RECEIVE MAP('A') END-EXEC.
can be translated to:
 MOVE 'A' TO CICS-STRING-VALUE(6)
 SET CICS-DATA-AREA(9) TO ADDRESS OF AI
 MOVE H'00000120' TO CICS-ARG-MASK
 MOVE 0 TO CICS-ARG-COUNT
 MOVE 68 TO CICS-FN-CODE
 MOVE -1 TO CICS-DEBUG-LINE
 CALL 'cics_api_exec_cobol' USING CICS-ARGS
 IF EIBLABEL NOT=0 GO TO CICS-API-ERROR
 END-IF

The translator modifies the linkage section by inserting the EXEC Interface Block (EIB) structure as the first parameter, and inserts declarations of the temporary variables that it requires into the working-storage section. It also inserts a DFHCOMMAREA if one is not present in the linkage section.

For C or C++
For a C or C++ application program, each command is replaced by one or more assignment statements and function calls. For example, a command such as:
 EXEC CICS RECEIVE MAP('A');
can be translated to:
 cics_api_strncpy(CicsArgs.ArgData[5].StringValue
                 , 'A', (short)7);
 CicsArgs.ArgData[8]DataArea = &a.ai;
 CicsArgs.ArgMask = 0x20000120;
 CicsArgs.FnCode = 68;
 CicsArgs.DebugLine = -1;
 cics_api_exec_c(&CicsArgs);
 }
Note: cics_api.h is shipped as part of TXSeries for Multiplatforms, and is automatically included in user programs by the CICS translator.
For PL/I

The IBM PL/I compiler has an integrated CICS processor and no intermediate files are generated.

For related information about translating, compiling, and link-editing CICS application programs, see Translating, compiling, and link-editing CICS application programs .