0% found this document useful (0 votes)
2 views61 pages

CICS Tutorial

The document details the author's extensive experience in COBOL programming, particularly in batch and online systems, with a focus on projects at Cognizant. It also explains the BMS macro coding structure, including the definitions and functionalities of various macros used in CICS applications, as well as the transaction life cycle within the CICS environment. Additionally, it outlines the roles of different control programs and tables in managing tasks and resources in CICS.

Uploaded by

reshmynair1987
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views61 pages

CICS Tutorial

The document details the author's extensive experience in COBOL programming, particularly in batch and online systems, with a focus on projects at Cognizant. It also explains the BMS macro coding structure, including the definitions and functionalities of various macros used in CICS applications, as well as the transaction life cycle within the CICS environment. Additionally, it outlines the roles of different control programs and tables in managing tasks and resources in CICS.

Uploaded by

reshmynair1987
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

+ RD

BMS MACRO:

• Throughout my career, I have gained extensive experience in COBOL programming,


particularly in batch and online [Link] my tenure at Cognizant, I worked on several
projects where I developed and enhanced COBOL programs for both batch processing and online
transaction systems using CICS.
• For instance, in the Telstra-CDBoR project, I was responsible for coding and testing various
modules that handled customer data processing, which required a deep understanding of COBOL
and its integration with other technologies.

My role involved writing efficient code to ensure optimal performance and reliability, which is
crucial in a production environment.

• Additionally, I have experience in debugging and troubleshooting COBOL applications,


which has honed my analytical skills and attention to detail.

BMS map is a program which is written in Assembly language to manage screens. The three macros
that are used to define the screen are DFHMSD, DFHMDI, and DFHMDF.

BMS Macro Coding Sheet.

Columns Macros

1-8 Label

10-15 Macro name

16-71 Operands

72 Continuation

DFHMSD is used to define a mapset with its characteristic and to end a mapset. So you will find
two DFHMSD in any BMS coding.
TYPE -It should be DSECT for Symbolic map generation, MAP for physical map generation and
FINAL to indicate the end of mapset. Alternatively symbolic parameter &SYSPARM can be coded in
the TYPE of defining DFHMSD and the value can be overridden in the PARM parameter of
assembly procedure. This avoids the change in the BMS coding.

MODE - IN for input maps like order entry screens and OUT for output maps like display screens
and INOUT for input-output maps like update screens.

LANG - It specifies the language in which the symbolic map is to be generated. It can be COBOL,
PLI, ASM or RPG.
STORAGE - AUTO is used to acquire separate symbolic map area for each mapset. BASE=MAP-
IOAREA allows multiple maps from more than one mapset to share same storage area. MAP-
IOAREA will be redefined multiple times to achieve it.

TIOAPFX - It should be ‘YES’ to reserve the prefix space of 12 bytes for BMS commands to access
TIOA properly. This is required for command level CICS.
CTRL -Device control requests are placed here. Multiple parameters are separated by comma.
FREEKB is used to unlock the keyboard. FRSET is used to reset the MDT of all the fields in all the
maps to zero. ALARM is used to set an alarm at screen display time. PRINT is used to send the
mapset to printer.
TERM -If anything other than 3270 terminal is used for display of screens, then it should be coded
here. This ensures device independence by means of providing the suffix. SUFFIX is used to specify
suffix for the terminal and it should correspond to TCT entry of the terminal.

DFHMDI is used to define a map with its characteristic in a mapset. There can be any number of
DFHMDI. Some of the important operands of DFHMDI are below:
 SIZE
It has two arguments namely length and breadth and as a whole the size of the map is specified
here.
SIZE = (Line,Column)
 LINE
The map starting line is mentioned here.
 COLUMN
The map-starting column within the LINE is mentioned here.
CTRL -Device control requests are placed here. Multiple parameters are separated by comma.
FREEKB is
used to unlock the keyboard. FRSET is used to reset the MDT of all the fields in all the maps to
zero. ALARM is used to set an alarm at screen display time. PRINT is used to send the mapset to
printer.
TIOAPFX
It should be ‘YES’ to reserve the prefix space of 12 bytes for BMS commands to access TIOA
properly.

This is required for command level CICS.

 POS
It has two arguments that decided the position of the field. The two arguments are line and
column. It is the position where the attribute byte of the field starts.
So if you code POS = (1,1), the attribute byte for that field is on line 1 in column 1, and the actual
data starts in column 2.
LENGTH - The length of the field is coded here. It excludes the attribute character.
ATTRIB - All the input and output fields are prefixed by one byte attribute field that defin+es the
attributes of the field. Some of the attributes are:
1. ASKIP/PROT/UNPROT
Mutually exclusive parameters that define the type of the field.
UNPROT is coded for input and input-output fields.
PROT is coded for output and stopper fields.
ASKIP is coded for screen literals and skipper fields. The cursor automatically skipped to next field
and so you cannot enter data into skipper field.
2. NUM
0-9,Period and – are the only allowed characters.
3. BRT/NORM/DRK
Mutually exclusive parameters that define the intensity of the field.
4. IC
Insert Cursor. Cursor will be positioned on display of map. If IC is specified in more than one field
of a map, the cursor will be placed in the last field.
5. FSET
Independent of whether the field is modified or not, it will be passed to the program. MDT is set
for the field.
 JUSTIFY
RIGHT is the default value. Code LEFT for numeric fields.
PICIN and PICOUT - It defines the Picture clause of the symbolic map in COBOL and useful for
numeric field editing.
INITIAL - The default value of the field is coded here. When the MAP is sent, this value will appear
in the field. The constant information like TITLE is coded using INITIAL keyword of field definition.
To avoid data traffic, these constant information fields should not be coded without LABEL
parameter. If there is no LABEL parameter, then symbolic map will not generated for those fields
as they are unnamed fields.

EXEC CICS SEND


MAP('map-name')
MAPSET('mapset-name')
EXEC CICS RECEIVE
[FROM(data-area)]
MAP('map-name6')
[LENGTH(data-value)]
MAPSET('mapset-name')
[DATAONLY]
[INTO(data-area)]
[MAPONLY]
[FROM(data-area)]
[FREEKB]
[LENGTH(data-value)]
[FRSET]
END-EXEC.
[ERASE/ERASEAUP]
[CURSOR]
END-EXEC.

Let us see the parameters used in the SEND MAP command.

 MAP('map-name')

Specifies the name of the map to be used.

 MAPSET('mapset-name')

Specifies the name of the mapset to be used. It is needed unless mapset name is the same as the
map name.

 FROM(data-area)

Specifies the data area containing the data to be processed.

 LENGTH(data-value)

Specifies the length of the data to be formatted as a halfword binary value. If the data area
sending the map is longer than the data to be mapped, LENGTH should be specified.
 MAPONLY

Specifies that only default data from the map is to be written.

 DATAONLY

Specifies that only application program data is to be written(i.e. Only the data from- your program
is sent to the screen). Any default data or attributes from the map are ignored.

 FREEKB

Keyboard should be unlocked after the data is written in screen. If FREEKB is not added, the
keyboard remains locked.

 FRSET

Flag Reset turns off the modified data tag(MDT) in the attribute byte for all the fields on the screen
before what you are sending is placed there.

 ERASE

This is used to clear the map on the screen when sending any map.

 ERASEAUP

This is used to clear the previous value on the screen when sending thee data only.

 CURSOR

This is used to position the cursor on the screen. Cursor is set by moving -1 to the L part of the
field and then sending the map.

EXEC CICS REWRITE EXEC CICS DELETE


FILE(name) FILE('filename')
FROM(data-area) RIDFLD(data-area) [RBA|RRN]
LENGTH(data-value) KEYLENGTH(data-value)
END-EXEC. [GENERIC|NUMERIC(rec-number)]
END-EXEC.

EXEC CICS STARTBR EXEC CICS READNEXT


FILE('file-name') FILE(file-name)
RIDFLD(data-area) [GENERIC] RIDFLD(data-area)
KEYLENGTH(data-value) INTO(data-area)
REQID(data-value) LENGTH(WS-LENGTH)
SYSID(system-name) KEYLENGTH(data-value)
GTEQ/EQUAL REQID(data-value)
END-EXEC. SYSID(system-name)
END-EXEC.

EXEC CICS READPREV EXEC CICS ENDBR


FILE(file-name) FILE('file-name')
RIDFLD(data-area) REQID(INTEGER-VALUE)
INTO(data-area) SYSID(SYSTEM-NAME)
LENGTH(WS-LENGTH) END-EXEC.
KEYLENGTH(data-value) EXEC CICS RESETBR
REQID(data-value) FILE('file-name')
SYSID(system-name) RIDFLD(dta-area)
+END-EXEC. GTEQ
END-EXEC.0

EXEC CICS WRITEQ TS EXEC CICS READQ TS


QUEUE('queue-name') QUEUE('queue-name')
FROM(queue-record) INTO(queue-record)
[LENGTH(queue-record-length)] [LENGTH(queue-record-length)]
[ITEM(item-number)] [ITEM(item-number)]
[REWRITE] [NEXT]
[MAIN/AUXILIARY] END-EXEC.
END-EXEC.

EXEC CICS WRITEQ TD EXEC CICS READQ TD


QUEUE('queue-name') QUEUE('queue-name')
FROM(queue-record) Into(Queue-record)
[LENGTH(queue-record-length)] [LENGTH(queue-record-length)]
END-EXEC. END-EXEC.

EXEC CICS DELETEQ TD


QUEUE('queue-name')
END-EXEC.
EXEC CICS LOAD EXEC CICS LINK
PROGRAM(Program Name) PROGRAM('PROGRAM')
SET(Pointer Reference) COMMAREA(WS-COMMAREA)
LENGTH(Data Area Length) LENGTH(70)
ENTRY(Pointer Reference) END-EXEC.
HOLD EXEC CICS XCTL
END-EXEC. PROGRAM('PROGRAM1')
COMMAREA(WS-COMMAREA)
LENGTH(70)
END-EXEC.

EXEC CICS READQ TS EXEC CICS XCTL


QUEUE('queue-name') PROGRAM(name)
INTO(queue-record) COMMAREA(ws-area)
[LENGTH(queue-record-length)] LENGTH(ws-length)
[ITEM(item-number)] END-EXEC.
[NEXT]
END-EXEC.
EXEC CICS LINK EXEC CICS LOAD
PROGRAM(name) PROGRAM(Program Name)
COMMAREA(ws-area) SET(Pointer Reference)
LENGTH(ws-length) LENGTH(Data Area Length)
END-EXEC. ENTRY(Pointer Reference)
HOLD
END-EXEC.

EXEC CICS RELEASE


PROGRAM(Program Name)
END-EXEC.
XPED

OPTION 2

TCP is known as Terminal Control Program.

 TCP is used to receive messages from the terminal.

 It maintains hardware communication requirements.

 It requests CICS to initiate the tasks.

KCP

KCP is known as Task Control Program.

 KCP is used to simultaneously control the execution of tasks and its related properties.
 It handles all the issues related to multi-tasking.

PCP

PCP is known as Program Control Program.

 PCP is used to locate and load programs for execution.

 It transfers the control between programs and in the end, it returns the control back to the
CICS.

FCP

FCP is known as File Control Program.

 FCP is used to provide application programs with services like read, insert, update or delete
records in a file.

 It keeps exclusive control over the records in order to maintain data integrity during record
updates.

SCP

SCP is known as Storage Control Program. It is used to control allocation and deallocation of storage
within a CICS region.

Advertisement

Control Tables

CICS consists of IBM-supplied CICS control programs and tables. These tables need to be updated
accordingly with the application information for successful execution of CICS application programs.
Following are the important Control Tables −

TCT

TCT `` is known as Terminal Control Table.

 ;When we login to a CICS terminal, an entry is made in the TCT table.

 TCT contains the terminal ID's that are connected to current CICS region.

 Terminal Control Program along with terminal control table recognize the incoming data
from the terminal.

PCTPCT is known as Program Control Table.

 It contains the Transaction IDs (TRANSID) and the corresponding program names or program
IDs.

 TRANSID is unique in PCT table.

PPT

PPT is known as Processing Program Table. PPT contains Program name or Mapset name, Task Use
Counter; Language, Size, Main storage address, Load library address, etc.

 Program or Mapset name is unique in a PPT table.


 CICS receives the transaction and a corresponding program name is allocated to the
transaction from the PCT. It checks if the program is loaded or not. If it is loaded, then the
task use counter is increased by 1. If the program is not loaded, then the program is first
loaded and the task use counter is set to 1. It gets the load library address from the PPT
table.

FCT

FCT is known as File Control Table.

 It contains File names, File type, record length, etc.

 All the files used in a CICS program must be declared in FCT and they are opened and closed
by CICS itself.

Transaction

When a transaction identifier TP02 is entered on the CICS terminal, first it checks if there is a
program associated with this Transaction identifier in the PCT table. If it finds one, then it checks in
the PPT table to find the location of the Program to execute it.

If the program is already available in the memory, it starts executing that particular program; if not, it
loads the program to the memory from the secondary storage and then starts executing it.

Transaction Life Cycle

The transaction life cycle has the following steps −


Step 1

The terminal operator initiates the transaction by typing a 1 to 4 character transaction-id and
pressing the ENTER key.

Step 2

The TCP periodically checks all the terminals for input. When a message is received, it does the
following −

 Instructs the SCP to create a TIOA.

 Places the message in the TIOA.

 Passes the control to the KCP.

Step 3

The KCP takes control from the TCP and does the following −

 Validates the transaction-id and security.

 Instructs the SCP to create a task control area.

 Assigns priority to the task based on Terminal priority (Set in TCT), Operator priority (Set in
SNT), and Transaction priority (Set in PCT).
 Adds the task to the queue of waiting programs.

 Dispatches waiting programs in the order of priority.

 Passes the control to the PCP.

Step 4

The PCP takes control from the KCP and does the following −

 Locates the program and loads it, if necessary.

 Transfers the control to the Application program.

Step 5

The Application program takes control from the PCP and does the following −

 Requests the TCP to place the message into the programs WORKING STORAGE area.

 Requests the FCP to retrieve records from the files.

Step 6

The FCP takes control from the Application program and does the following −

 Requests a File work area from the SCP.

 Informs the KCP that this task can wait until the I/O is complete.

Step 7

The KCP does the following −

 Dispatches the next task in the queue.

 Re-dispatches the old task when I/O is complete.

 Transfers the control to the FCP.

Step 8

The FCP returns control to the Application program.

Step 9

The Application program does the following −

 Processes the file data.

 Requests TCP to send an I/O message.

 Returns control to the PCP.

Step 10

The PCP returns the control back to the KCP requesting it to end the task.

Step 11

The KCP instructs the SCP to free all the storage allocated to the task (except TIOA).
Step 12

The TCP does the following −

 S0ends the output to the terminal.

 Requests the SCP to release the TIOA.

 The system sends a message to the screen and waits for the users response.

 The time taken by user to respond is known as Think Time. This time is considerably high,
which is a major drawback of conversion programs.

 The user provides the necessary input and presses an AID key.

 The application processes the users input and sends the output.

 The program is loaded into the main storage at the beginning and is retained till the
task .ends.

 .Following are the two types of return statements which are used in
CICS −
 Return-1
 When the following unconditional return statement is issued, the
task and the transaction (program) is terminated.
 EXEC CICS RETURN
 END-EXEC.
 Return-2
 When the following conditional return, i.e., return with TRANSID
statement is issued, the control returns to the CICS with the next
transid to be executed. The next transaction starts when the user
presses an AID key.
 EXEC CICS RETURN
 TRANSID ('trans-id')
 [COMMAREA(WS-COMMAREA)]
 END-EXEC.
Advantages of Pseudo Conversion

Following are the advantages of pseudo conversion −

 The resources are best utilized. Resources are released as soon as the program is suspended
temporarily.

 It looks as if it is in conversational mode.

 It has better response time.

------------------------------------------------------------------------------------------------------------------------------
1

Adding a column to a table:

Analysis –

Have a meeting with dba: get the proper approvals

Write query

To set default as zero’s for the column,set null

Dclgen of the table is impacted

We will create another dclgen

SORT JOIN – TO JOIN TWO FILES BASED ON A KEY


We can make use of SORT to join two files and writes records from both files

1. Both Files Matching Records (Inner Join)

Write only records that match on key from both files.

//STEP01 EXEC PGM=SORT


//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=[Link],DISP=SHR
//SORTJNF2 DD DSN=[Link],DISP=SHR
//SORTOUT DD DSN=[Link],
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(100,200),RLSE),
// DCB=(RECFM=FB,BLKSIZE=0,LRECL=80)
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILES=F1,FIELDS=(1,10,A)
JOINKEYS FILES=F2,FIELDS=(1,10,A)
REFORMAT FIELDS=(F1:1,71,F2:1,9)
/*

Here both the files have keys at 1-10. And only the matching records are written into output file.

REFORMAT fields tells the sort on what fields to be written into output file from the input files.

2. Both Files Matching Records + Non Matching from File1 (Left outer join)

//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILES=F1,FIELDS=(1,10,A)
JOINKEYS FILES=F2,FIELDS=(1,10,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,71,F2:1,9)
/*

3. Non Matching from File1

//SYSIN DD * SORT FIELDS=COPY


JOINKEYS FILES=F1,FIELDS=(1,10,A)
JOINKEYS FILES=F2,FIELDS=(1,10,A)
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:1,71)
/*

4. Both Files Matching Records + Non Matching from File2(Right outer join)

//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILES=F1,FIELDS=(1,10,A)
JOINKEYS FILES=F2,FIELDS=(1,10,A)
JOIN UNPAIRED,F2
REFORMAT FIELDS=(F1:1,71,F2:1,9)
/*

5. Non Matching from File2

//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILES=F1,FIELDS=(1,10,A)

JOINKEYS FILES=F2,FIELDS=(1,10,A)
JOIN UNPAIRED,F2,ONLY
REFORMAT FIELDS=(F2:1,9)
/*

6. Both Files Matching Records + Non Matching from both files

//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILES=F1,FIELDS=(1,10,A)
JOINKEYS FILES=F2,FIELDS=(1,10,A)
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,71,F2:1,9)
/*
1. CEMT SET PROG(mapset-name) NEW –COMMAND TO ADD NEW COPY

 Type the following command to send the Map to the terminal −

CECI SEND MAP(map-name) MAPSET(mapset-name) ERASE FREEKB

CEMT (Master Terminal Transaction)

Used to view or change the status of CICS resources.

 Syntax Structure: CEMT <Action> <Resource> <(ResourceName)> [Attributes/Options]

 Key Actions: INQUIRE (or I to view), SET (or S to change).

Common Applications:
 Load a new version of a COBOL program (Newcopy):
CEMT SET PROGRAM(PROGNAME) NEWCOPY

 Check if a file is open or closed:


CEMT I FILE(FILENAME)

 Open a file for application use:


CEMT S FILE(FILENAME) OPEN ENABLED

 Close a file to release it for a batch job:


CEMT S FILE(FILENAME) CLOSED DISABLED

 View active tasks running in the region:


CEMT I TASK

 Forcefully kill a hung user task:


CEMT S TASK(TaskNumber) PURGE

2. CEDF (Execution Diagnostic Facility)

Used to debug application programs interactively. It intercepts execution before and after every EXEC
CICS command.

 Syntax Structure: CEDF <TerminalID> [,ON|,OFF]

Common Applications:

 Debug a program on your current terminal:


Type CEDF on a blank screen and press Enter. (Message displays: EDF MODE IS ON). Then
clear the screen and run your user transaction.

 Turn off debugging on your current terminal:


CEDF ,OFF

 Debug a transaction running on a different terminal (e.g., terminal T123):


CEDF T123

3. CECI (Command Interpreter)

Used to test individual CICS commands interactively without writing, compiling, or compiling a
COBOL program.

 Syntax Structure: CECI <CICS Command> [Options]

Common Applications:

 Read a record from a file directly on screen:


CECI READ FILE('MYFILE') RIDFLD('KEY12345')

 Send a text message to the terminal screen:


CECI SEND TEXT FROM('HELLO WORLD')
 Read data from a Temporary Storage Queue:
CECI READQ TS QUEUE('MYTSQ') ITEM(1)

4. CEBR

(Temporary Storage Browse)

Used to inspect, modify, or delete the contents of Temporary Storage Queues (TSQs).

 Syntax Structure: CEBR <QueueName>

Common Applications:

 Browse items inside a specific TSQ:


CEBR TSQNAME1

 Delete an entire TSQ to clear space:


Once inside the CEBR screen displaying the queue, press PF5 (Delete).

5. CEDA (Resource Definition Online)

Used to define, alter, and manage CICS system definitions (groups and lists).

 Syntax Structure: CEDA <Action> <ResourceType> <(ResourceName)> [GROUP(GroupName)]

 Key Actions: DEFINE, ALTER, DISPLAY, VIEW, INSTALL.

Common Applications:

 Define a new transaction code in a specific group:


CEDA DEFINE TRANSACTION(TRN1) GROUP(MYGRP)

 Define a new program name to tie to that transaction:


CEDA DEFINE PROGRAM(PROG1) GROUP(MYGRP)

 Dynamically install definitions so they are active immediately without a CICS reboot:
CEDA INSTALL GROUP(MYGRP)

6. CMAC (CICS Messages and Codes)

Used to instantly look up the meaning of CICS error messages or abnormal termination (abend)
codes.

 Syntax Structure: CMAC <MessageID/AbendCode>

Common Applications:

 Look up a transaction abend code (e.g., AEIL - occurs when a file is disabled):
CMAC AEIL

 Look up a specific CICS system message code:


CMAC DFHFC0501
7. CESN & CESF (Sign-On / Sign-Off)

Used to securely enter and exit the CICS region.

 Sign-On Syntax: CESN (Pressing enter opens a secure menu to type User ID and Password).

 Shortcut Sign-On: CESN USER=myuserid,PS=mypassword

 Sign-Off (Disconnect): CESF

 Sign-Off (Logoff completely from network): CESF LOGOFF

Let me know if you would like to proceed by:

 Providing a step-by-step example of debugging a specific program error using CEDF or CECI.

 Looking up the exact syntax options for a specific resource type within CEMT or CEDA.

1. Response Code Errors (EIBRESP/EIBRESP2)

These are set after every EXEC CICS command:

 NOTFND → Resource or record not found.

 DUPREC → Duplicate record key during WRITE.

 INVREQ → Invalid request (wrong sequence or parameter).

 LENGERR → Length error (buffer too small or mismatch).

 NOSPACE → No space available in queue or storage.

 NORMAL → Successful execution (not an error).

2. Common Abend Codes

CICS abends are 4-character codes:

 AEI0 → Program issued invalid command.

 AEI9 → Program not found.

 AEIP → Protection exception (storage violation).

 APCT → Program not defined in PPT.

 AEY9 → File not open or unavailable.

 AEXZ → Map not found.

 AEZ0 → Mapset not found.

First create the macro :

DFHDCT DESTID=Q1 TRANSID=TRN1 RECORDSIZE=80 BLOCKSIZE=800


TYPE=INTRA
OR
DFHDCT TYPE=INTRA, X
DESTID=Q1, X * Queue name (4 chars max)
TRANSID=TRN1, X * Transaction triggered when data arrives
RECORDSIZE=80 X * Each record length

DFHDCT TYPE=EXTRA, X
DESTID=Q2, X * Queue name
DSNAME=[Link], X * External dataset name
BLOCKSIZE=800, X * I/O block size
RECORDSIZE=80 X * Each record length

//ASMSTEP EXEC PGM=ASMA90

//SYSLIB DD DSN=[Link],DISP=SHR

//SYSIN DD DSN=[Link],DISP=SHR

//SYSLMOD DD DSN=[Link],DISP=SHR

//SYSPRINT DD SYSOUT=*

//LKEDSTEP EXEC PGM=IEWL

//SYSLMOD DD DSN=[Link],DISP=SHR

//SYSLIN DD DSN=[Link],DISP=SHR

Execution Stage

 When CICS starts, it loads the DCT table.

 Programs can then use WRITEQ TD, READQ TD, etc., against the TDQs defined in DFHDCT.

TSQ :

FEATURE DESCRIPTION

DYNAMIC CREATION Created automatically when first written

SCOPE Can be private (task-specific) or shared (accessible by multiple


tasks)

ACCESS Random (by ITEM number) or sequential

LIFETIME Exists until explicitly deleted or CICS region ends

IDENTIFICATION DIVISION.

PROGRAM-ID. DEMOPGM.

DATA DIVISION.

WORKING-STORAGE SECTION.

01 WS-DATA.
05 WS-MSG PIC X(50).

LINKAGE SECTION.

* DFHEIBLK provides system info (EIB)

01 DFHEIBLK.

COPY DFHEIBLK.

* COMMAREA for passing data

01 DFHCOMMAREA.

05 CA-DATA PIC X(100).

PROCEDURE DIVISION USING DFHEIBLK DFHCOMMAREA.

DISPLAY 'Transaction ID: ' EIBTRNID

DISPLAY 'Terminal ID: ' EIBTRMID

DISPLAY 'Data Passed: ' CA-DATA

EXEC CICS RETURN END-EXEC.

You might also like