Table of Contents
- Overview
- What
--cicsdoes - How EXEC CICS becomes Java
- Supported EXEC CICS commands
- CICS and the compile strategy
- What you do not configure at compile time
- Summary
- Related articles
Audience: developers and build engineers compiling PL/I programs that contain embedded EXEC CICS commands. Explains what the --cics (and --exci) compiler options do, how CICS commands are translated to Java, and how this pairs with the compile strategy. For runtime setup and deployment, see "How to Configure and Deploy a Migrated CICS Application."
Overview
Online PL/I programs drive screens, files, queues, and program flow through command-level CICS — EXEC CICS … ; blocks. The --cics compiler option tells the Heirloom PL/I compiler to recognize and translate those commands. Without it, EXEC CICS is not processed; with it, each command becomes a Java call into the runtime's CICS layer, which provides the same services on standard Java infrastructure.
This article covers the compile-time side: the option, the related --exci option, what the generated Java looks like, and why CICS programs are normally built with the instance strategy. The run-time side — region configuration, program/file registries, BMS, and deployment — is covered in How to Configure and Deploy a Migrated CICS Application.
Note: CICS and SQL processing are independent. A program that uses both is compiled with
--cics --sqltogether.
What --cics does
--cics
When set, the compiler:
-
Parses each
EXEC CICS … ;block against its CICS command grammar. -
Maps options —
RESP/RESP2,NOHANDLE,INTO/FROM,LENGTH,RIDFLD, map/program names, and so on — to builder calls. - Generates Java that invokes the runtime's CICS services and captures results back into your variables.
--exci — calling CICS from batch
--exci
--exci selects the External CICS Interface form of code generation. It is for batch programs that need to LINK into CICS programs from outside a CICS region, rather than running inside one. In EXCI mode the generated LINK uses the external-interface path (with an application id, no online transaction context) instead of the in-region path. Use --cics for programs that run as online transactions; use --exci for batch callers that reach into CICS.
How EXEC CICS becomes Java
Each command is translated into a call on a fluent CICS builder, with the command's options chained on and results read back afterward. A program-control LINK:
EXEC CICS LINK PROGRAM(PGM) COMMAREA(CA) LENGTH(LEN) RESP(RC) END-EXEC;
becomes (illustrative):
CICSLink cicsLink = CICSBuilder.getInstance().link(_transenv)
.program(pgm)
.commarea(ca)
.length(len)
.resp(rc);
cicsLink.execute(this);
rc = (Integer) cicsLink.resp(); // RESP read back after execution
Points to recognize when reading the output:
-
A builder per command.
CICSBuilder.getInstance().<command>(_transenv)with the command's options chained on, then.execute(this). -
_transenvcarries task state. The transactional environment (terminal id, transaction id, unit-of-work) is passed into each command. -
RESP/RESP2are read back afterexecute(...)and cast to your variable's type. If aRESPvariable is referenced but not declared, the compiler auto-declares it as an integer so the program still compiles. -
NOHANDLEis honored to suppress condition handling for a command.
Response codes, conditions, and the EIB
-
EXEC CICS HANDLE CONDITION/IGNORE CONDITIONare translated so your condition-driven flow is preserved. - Symbolic response checks via
DFHRESP(...)(andDFHVALUE(...)) resolve to the corresponding numeric values, soIF RC = DFHRESP(NOTFND)works as written. -
EXEC CICS ADDRESS EIB(...)gives your program the Execution Interface Block; theEIBxxxfields (EIBCALEN,EIBTRMID,EIBAID,EIBRESP, …) are then read in the usual way.
Supported EXEC CICS commands
The compiler handles a broad command-level surface — over ninety distinct commands — across the usual functional groups:
| Group | Representative commands |
|---|---|
| Terminal / BMS |
SEND MAP, RECEIVE MAP, SEND, SEND TEXT, SEND CONTROL, SEND PAGE, RECEIVE
|
| Program control |
LINK, XCTL, RETURN (incl. TRANSID), LOAD, RELEASE
|
| File control |
READ, READNEXT, READPREV, WRITE, REWRITE, DELETE, STARTBR, ENDBR, RESETBR, UNLOCK
|
| Temporary storage / transient data |
WRITEQ TS, READQ TS, DELETEQ TS, WRITEQ TD, READQ TD, DELETEQ TD
|
| Storage |
GETMAIN, FREEMAIN
|
| Task & interval control |
START, RETRIEVE, ASKTIME, FORMATTIME, DELAY, CANCEL, SUSPEND, SYNCPOINT
|
| Conditions & abend |
HANDLE CONDITION, IGNORE CONDITION, ABEND
|
| Addressing / system data |
ADDRESS, ASSIGN
|
| Serialization |
ENQ, DEQ
|
| Containers / channels |
PUT/GET CONTAINER, STARTBROWSE/ENDBROWSE CONTAINER
|
| Inquire / set |
INQUIRE/SET for FILE, PROGRAM, TRANSACTION, TASK, TERMINAL, TDQUEUE, … |
| Services & spooling |
INVOKE SERVICE, SPOOLOPEN/WRITE/CLOSE, WRITE OPERATOR
|
See Supported CICS Features for the published feature list, and CICS INVOKE SERVICE Integration Guide for web-service calls.
CICS and the compile strategy
CICS programs are normally compiled with the instance strategy:
--cics --strategy instance
Each CICS transaction is a separate task, and instance strategy gives every invocation a fresh program instance (matching PL/I's AUTOMATIC storage and keeping per-task state isolated). The CICS command execute(this) calls pass that instance as their context, and ON-condition handlers are wired to it. The compiler does not force instance strategy, but it is the right pairing for online transaction programs. See Static vs Instance Strategy for the details.
What you do not configure at compile time
Region and inventory details are run-time configuration, not compiler options:
- the CICS application id (
applid), program and transaction registries, - file/DCB definitions and BMS mapsets,
- programs that start automatically (PLT).
These live in your deployment configuration (deploy.properties and friends) and are covered in How to Configure and Deploy a Migrated CICS Application. The compiler only produces CICS-aware Java; how the region is wired is decided at deployment.
Summary
-
--cicsmakes the compiler parse and translate embeddedEXEC CICS; without it, CICS commands are not processed. -
--excigenerates the External CICS Interface form so batch programs canLINKinto CICS from outside a region. - Each command becomes a fluent builder call (
CICSBuilder…execute(this)) withRESP/RESP2,NOHANDLE, andDFHRESP(...)preserved, and the EIB reachable viaADDRESS EIB. - The compiler supports a broad command surface (BMS, program/file control, TS/TD queues, storage, task/interval control, conditions, containers, inquire/set).
- CICS programs are normally built with
--strategy instance; region and inventory setup is run-time configuration, not a compiler option.
Related articles
- How the Heirloom PL/I Compiler Translates Your Code and Reading Your Generated Java.
- Compiling EXEC SQL Programs (the --sql Option).
- Static vs Instance Strategy.
- How to Configure and Deploy a Migrated CICS Application and How to Build a CICS Application with BMS Screens.
- Supported CICS Features and CICS INVOKE SERVICE Integration Guide.
0 Comments