Customer Information Control System Command Level Programming
Instructor Notes:
Add instructor notes
here.
Customer Information Control
System
Lesson 5: Command Level Programming
Page – 05 - 1
Customer Information Control System Command Level Programming
Instructor Notes:
Lesson Objectives
CICS command format
Command Language Translator
COBOL/CICS Program Structure
Page – 05 - 2
Customer Information Control System Command Level Programming
Instructor Notes:
5.1: CICS Program Development
The Concept
Application programming in CICS can be done with many host languages that are
supported by IBM, such as COBOL, PL/1, and Assembler.
The coding can be done by using either of the following:
• Macro level
• CICS Command level library
CICS Program Development:
Macro Level Programming: In the earlier versions of CICS, the CICS
application programs were written based on CICS macros which
were functionally primitive in comparison with CICS commands.
Macro Level Programming involves calling macros in the host
language using the program areas for accessing CICS resources.
This style of programming is cryptic and complex as the
programmer is required to remember all the macros and their
parameters.
Command Level Programming: Command Level Programming is a
high-level language, which provides set of CICS commands for
accessing the resources. Programming in this style is
comparatively easier. Command level Preprocessor translates the
CICS commands into equivalent macro calls.
Page – 05 - 3
Customer Information Control System Command Level Programming
Instructor Notes:
5.2: CICS Command Format
The Format
In CA-Realia a CICS commands are embedded into the Host language, for example, in the
lot of support files get Procedure Division of COBOL program.
generated when the CICS commands in a COBOL program are delimited by
Source file is compiled. • EXEC CICS………………END-EXEC.
The file with the ext cic EXEC CICS is coded in margin B of COBOL program.
is the cobol file which The command level translator replaces these statements by COBOL “MOVE”
statements followed by COBOL “CALL” statement.
contains the call
The translated module is compiled and linked to produce an executable load
statements. Show this file module.
to the participants . The translator also includes copy books into program.
Page – 05 - 4
Customer Information Control System Command Level Programming
Instructor Notes:
5.2: CICS Command Format
The Format
EXEC CICS Function
[option(argument)
option(argument)
--------
--------
]
END-EXEC.
CICS Command Format:
“Function” describes the operation required, for example,
SEND/RECEIVE.
“Option” describes any of the many optional facilities available with
each function.
Options can be coded in any order but preferably one option
per line. Options may be followed by an argument in
parentheses.
“Argument” is a value, can be a data-name or literal.
Page – 05 - 5
Customer Information Control System Command Level Programming
Instructor Notes:
5.3: Command Language Translator
Use of Command Language Translator
COBOL
Source
Program
Translator
Translated
Source
Program
COBOL Compiler
Object Module Link Edit Load Module
Command Language Translator:
Separate translators are available for Assembly, COBOL, and PL/1
languages with embedded CICS.
The translator is executed in a separate job step.
The job step sequence is :
Translate --- Compile (or assemble) --- Link edit
Each translator is host language oriented and accepts the source
program as input from SYSIN.
The translator writes the source listing and error messages to
SYSPRINT.
The translated source program is accepted as input by the COBOL
compiler and link edited to generate a load module.
The translator modifies the linkage section by inserting the EIB
structure as the first parameter, and inserts declaration of the
temporary variables that it requires into working storage section.
For COBOL application program, each command is replaced by one or
more COBOL move statements followed by a COBOL CALL
statement.
MOVE statement assign constants to COBOL data variables.
The constants are coded as arguments to options in the commands.
Page – 05 - 6
Customer Information Control System Command Level Programming
Instructor Notes:
5.4: COBOL / CICS Program Structure
The Syntax
IDENTIFICATION DIVISION.
PROGRAM-ID.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
Variable declaration
File layout
Symbolic map
Copy books
DFHEIVAR
LINKAGE SECTION.
DFHCOMMAREA
EIBBLOCK
BLL CELLS
PROCEDURE DIVISION.
Page – 05 - 7
Customer Information Control System Command Level Programming
Instructor Notes:
5.4: COBOL / CICS Program Structure
Prohibitions in CICS
The following COBOL statements are prohibited in a CICS application program:
• ACCEPT, CURRENT-DATE, DATE DAY, DISPLAY, EXHIBIT, STOP RUN, TRACE
• Any I/O statements (OPEN, CLOSE, REPORT WRITER Feature)
• SORT Feature
COBOL / CICS Program Structure:
The CICS application program must end with the CICS RETURN
command and / or GOBACK statement.
The CALL statement is allowed:
If the called program does not issue any CICS commands or
inhibited COBOL statements mentioned above.
If it is written as a reentrant program.
The CALL statement, in this case, can be issued as shown in the
following example:
CALL subprog USING xxx yyy zzz
Page – 05 - 8
Customer Information Control System Command Level Programming
Instructor Notes:
Summary
CICS command format
Command Language Translator
COBOL/CICS Program Structure
Page – 05 - 9
Customer Information Control System Command Level Programming
Instructor Notes:
Review Questions
Question 1: ___ statement is prohibited in a CICS program.
• Option 1: Accept
1. FD • Option 2: Read
• Option 3: Write
2. False
• Option 4: FD
Question 2: EXEC CICS is coded in margin B of COBOL program.
• True/False
Page – 05 - 10