0% found this document useful (0 votes)
9 views

Advanced C Ics

This document discusses various techniques for file handling in CICS using COBOL, including: - Sequential processing using BROWSE commands like STARTBR, READNEXT, READPREV, and ENDBR. - Using VSAM alternate indexes and generic keys to retrieve non-unique records. Generic keys allow matching on a portion of the full primary or alternate key. - Techniques like RESETBR to reposition browsing and skip sequential processing by modifying the RIDFLD before READNEXT. Exception conditions from browse commands are also outlined. The document provides examples and explanations of CICS commands for file handling and browsing indexed files. It covers concepts and best practices for working with VSAM files in

Uploaded by

maria joão
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Advanced C Ics

This document discusses various techniques for file handling in CICS using COBOL, including: - Sequential processing using BROWSE commands like STARTBR, READNEXT, READPREV, and ENDBR. - Using VSAM alternate indexes and generic keys to retrieve non-unique records. Generic keys allow matching on a portion of the full primary or alternate key. - Techniques like RESETBR to reposition browsing and skip sequential processing by modifying the RIDFLD before READNEXT. Exception conditions from browse commands are also outlined. The document provides examples and explanations of CICS commands for file handling and browsing indexed files. It covers concepts and best practices for working with VSAM files in

Uploaded by

maria joão
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 119

Advanced CICS Programming in

COBOL

Cognizant Technology Solutions


SESSION BREAKUP
Day Session & Topic
1 1 File Handling
2 File Handling (contd.)
2 1 Terminal Handling
2 Temporary Storage
3 1 Interval & Task Control
2 Program & Storage Control
4 1 Error Processing
5 1 Intercommunication
2 Intercommunication (contd.)

March 18,2000 BNG Version 2.0 2


Day 1 - Session 1

File Handling
File Handling
 Sequential Processing using BROWSE
commands
 VSAM Alternate Index
 Generic Key
 Mass Insert
 CICS Data Tables

March 18,2000 BNG Version 2.0 4


Sequential Processing Using
Browse Commands
 STARTBR Command
 READNEXT Command
 READPREV Command
 ENDBR Command
 RESETBR Command

March 18,2000 BNG Version 2.0 5


STARTBR Command
STARTBR DATASET(filename)
RIDFLD(data-area)
REQID(data-value)
[RRN | RBA]
[GTEQ | EQUAL]
[GENERIC]
[KEYLENGTH(data-value)]
RESP(data-area)

EXEC CICS
STARTBRDATASET(‘CUSTMAS’)
RIDFLD(CUSTOMER-NO)
RESP(RESPONSE-CODE)
END-EXEC

March 18,2000 BNG Version 2.0 6


STARTBR Command
DATASET The file name from the file control table
RIDFLD The field identifying the record where the browse
operation will start
RRN The file is relative record file
RBA The file is a ESDS
GTEQ The browse operation will start at the first record
whose key is greater than or equal to the value in RIDFLD
EQUAL The browse operation will start at the record whose
key value is equal to the value in RIDFLD

March 18,2000 BNG Version 2.0 7


STARTBR Command
GENERIC Only part of the key in the RIDFLD field
should be used
KEYLENGTH
A binary half word or literal value that
indicate the length of the key
RESP A binary full word item

March 18,2000 BNG Version 2.0 8


READNEXT Command
READNEXT DATASET(filename)
INTO(data-area)
RIDFLD (data-area)
[RRN | RBA]
[GENERIC]
[KEYLENGTH(data-value)]

EXEC CICS
READNEXT DATASET(‘ACCOUNT’)
INTO(ACCOUNT-RECORD)
RIDFLD(AR-ACCUONT-NUMBER)
RESP(RESPONSE-CODE)
END-EXEC

March 18,2000 BNG Version 2.0 9


READNEXT Command
DATASET The file name from the File Control Table
INTO The area that will contain the record being
read
RIDFLD Must specify the same data name specified in
the STARTBR command
RRN The file is a relative record file
RBA The file is a ESDS
GENERIC Only a part of the key in the RIDFLD
should be used

March 18,2000 BNG Version 2.0 10


READNEXT Command
KEYLENGTH
A binary half word or literal value that
indicates the length of the key.

March 18,2000 BNG Version 2.0 11


Skip Sequential Processing
 Can be achieved by increasing the RIDFLD value
before issuing the next READNEXT command
 Applied only for forward browsing
 VSAM reads forward in the index from the current
position
 Faster for relatively close but not adjacent records
 If the records are very far, the response time will
increase. In such cases, RESTBR should be used

March 18,2000 BNG Version 2.0 12


READPREV Command
READPREVDATASET(filename)
INTO(date-area)
RIDFLD(data-area)
[RRN | RBA]
[GENERIC]
[KEYLENGTH(data-
value)]
March 18,2000 BNG Version 2.0 13
READPREV Command
DATASET The file name from the File Control Table
INTO The area that will contain the record being
read
RIDFLD Must specify the same data name specified in
the STARTBR command
RRN The file is a relative record file
RBA The file is an ESDS
GENERIC Only part of the key in the RIDFLD field
should be used

March 18,2000 BNG Version 2.0 14


READPREV Command
KEYLENGTH
A binary half word or literal value that
indicates the length of the key.

March 18,2000 BNG Version 2.0 15


ENDBR Command
ENDBR DATASET(filename)

 Should be issued before any update operation


can be performed on the file. Other wise the
results are un-predictable
 Syncpoint should be preceeded by ENDBR
command. Basically Browing is a LUW.
 Always use to avoid dead locks
March 18,2000 BNG Version 2.0 16
RESETBR Command
RESETBR DATASET(file name)
RIDFLD(data-area)
[RRN | RBA]
[GTEQ | EQUAL]
[GENERIC]
[KEYLENGTH(data-
value)]
March 18,2000 BNG Version 2.0 17
RESETBR Command
DATASET The file name from the File Control table
RIDFLD The field identifying the record where the browse
operation will be repositioned
RRN The file is a relative record file
RBA The file is as ESDS
GTEQ The browse operation will be repositioned at
the first record whose key is greater than or equal to the
value in RIDFLD
EQUAL The browse operation will be repositioned at
the record whose key is equal to the value id RIDFLD

March 18,2000 BNG Version 2.0 18


RESETBR Command
GENERIC Only a part of the key in the RIDFLD field
should be used
KEYLENGTH
A binary half word or literal value that
indicates the length of the key.

March 18,2000 BNG Version 2.0 19


Exceptional Conditions
DSIDERR The data set is not in the FCT
ENDFILE There are no more records to be read
ILLOGIC A VSAM error has occurred
INVREQ The browse request is invalid (not specified in
FCT)
IOERR An I/O error has occurred
LENGERR A length error has occurred
NOTFNDThe record specified in a STARTBR command
does not exist
NOTOPEN The data set is not open
March 18,2000 BNG Version 2.0 20
Exceptional Conditions
DUPKEY Indicate that more records exist
with the same key (AIX)

March 18,2000 BNG Version 2.0 21


Day 1 - Session 2

File Handling (contd.)


VSAM Alternate Index
 Terminology
– Alternate Index
– Base Cluster
– Unique Key
– Non unique Key
– Path
– Upgrading / Upgradable Index / Upgrade set

March 18,2000 BNG Version 2.0 23


Using Alternate Index in CICS
 Browse commands are to be used for retrieving non-
unique key records
 DATASET option to have the Path name
 STARTBR command to have EQUAL option
– Check for NOTFND condition
 Allowable Response codes
– DUPKEY & NORMAL
 Check for DUPKEY condition
– raised if there is atleast one more record with the same key

March 18,2000 BNG Version 2.0 24


STARTBR Example
STARTBR DATASET(‘INVPATH’)
RIDFLD(CM-CUSTOMER-
NO)
EQUAL
RESP(RESPONSE-CODE)

March 18,2000 BNG Version 2.0 25


Using Generic Key in CICS
 Portion of a primary or alternate key used to identify
records in a KSDS
 Has to begin at the first byte of the complete key
 The length can not be equal to the complete key of
the KSDS
 RIDFLD should be large enough to hold the
complete key
 Forward browsing only is possible. READPREV
will raise INVREQ condition
March 18,2000 BNG Version 2.0 26
Using Generic Key in CICS
 Can be used with browse commands
 GENERIC & KEYLENGTH options are to be coded
 RIDFLD should be large enough to hold the record’s entire key
 INVREQ is raised if KEYLENGTH is not less than the length of
the complete key
 When used with STARTBR command the effect is similar to
GTEQ
 GENERIC option can be used in READ & DELETE commands
also
 Length could be changed using RESETBR

March 18,2000 BNG Version 2.0 27


Using Generic Key in CICS
Example with GTEQ
MOVE VENDNOI TO IP-VENDOR-NO.
MOVE LOW-VALUE TO IP-ITEM-NO.
EXEC CICS
STARTBR DATASET(‘INVPART’)
RIDFLD(IP-RECORD-KEY)
GTEQ
RESP(RESPONSE-CODE)
END-EXEC
Example with GENERIC
MOVE VENDOI TO IP-VENDOR-NO
EXEC CICS
STARTBR DATASET(‘INVPART)
RIDFLD(IP-RRECORD-NO)
GENERIC
KEYLEN(4)
EQUAL
RESP(RESPONSE-CODE
END-EXEC

March 18,2000 BNG Version 2.0 28


Using Generic Key in CICS
Example for GENERIC in READ
READ DATASET(‘INVPART’)
INTO(INV-PARTS-REC)
RIDFLD(IP-REC-KEY)
GENERIC
KEYLENGTH(4)
EQUAL
RESP(RESPONSE-CODE)
Example for GENERIC in DELETE
DELETE DATASET(‘INVPART’)
RIDFLD(IP-REC-KEY)
GENERIC
KEYLENGTH(4)
EQUAL
NUMREC(WS-DEL-CTR)
RESP(RESPONSE-CODE)

March 18,2000 BNG Version 2.0 29


MASSINSERT
 Used when more than one record is to be
written to the same point in a file
 Makes insertion more efficient
 Applicable for KSDS, ESDS & PATH
 UNLOCK command has to be used to end the
MASSINSERT operation
 No file control command can be issued before
the MASSINSERT ends.
March 18,2000 BNG Version 2.0 30
MASSINSERT example
WRITE DATASET(‘CUSTINV’)
FROM(INVOICE-REC)
RIDFLD(INV-REC-KEY)
MASSINSERT
RESP(RESPONSE-CODE)

March 18,2000 BNG Version 2.0 31


CICS Data Tables
 To improve the performance of files that are accessed frequently
 A virtual storage copy of a KSDS file
 The KSDS is copied to the table at CICS startup
 Types of Data Tables
– CICS maintained tables (CMT)
• CICS automatically updates the source data set whenver an update takes
place & vice versa
• User program need not have to wait till the update is completed in the source
data set
– User maintained tables (UMT)
• Needs a user written program that periodically updates the source data set

March 18,2000 BNG Version 2.0 32


CICS Data Tables
 Types of data tables (contd)
– Shared Data Tables
• Works like CMT or UMT but it can be accessed by more than
one CICS system under the same MVS system
• Kept in a separate address space accessible by mulltiple CICS
systems
• It is owned by one of the CICS regions
 The tables are defined by the system programmer
in FCT through batch or RDO

March 18,2000 BNG Version 2.0 33


Performance improvements on
VSAM Data set access
 Minimize the time that VSAM resources are
reserved for exclusive use
 Use MASSINSERT if you are inserting multiple
records at the same position of the file.
 Use skip sequential if records are not together but
they are relatively close.
 Use GENERIC option to delete records with keys
starting with the same string.

March 18,2000 BNG Version 2.0 34


Day 2 - Session 1

Terminal Handling
Terminal Handling
 Logical Message Building
– Concepts & Terminology
– SEND TEXT
– SEND PAGE
 Printer Output
 Message Routing
 RECEIVE Command
 SEND Command
March 18,2000 BNG Version 2.0 36
Logical Message Building

Concepts & Terminology


Logical Message Building
Concepts & Terminology
Logical Message
A single unit of output that’s created from one or more SEND TEXT or
SEND MAP commands
Terminal Paging / Page Building
The process of building a message page
Message Delivery
The process of delivering a message to a terminal
Message Disposition
 Terminal Disposition
 Paging Disposition
 SET Disposition

March 18,2000 BNG Version 2.0 38


Logical Message Building
Concepts & Terminology
Terminal Disposition
 Logical message is directly sent to the terminal as it is
created
 Message flow
– “Page & text build program” a component of BMS module
processes SEND TEXT & SEND MAP commands & formats the
data in “page buffer”
– When the page is full, “terminal page processor”, another
component of BMS module transfers the data to the terminal
 Logical message is built & delivered one page at a time

March 18,2000 BNG Version 2.0 39


Logical Message Building
Concepts & Terminology
Paging Disposition
 Entire message is held in temporary storage until an operator
retrieves it.
 When the page buffer is full, the page is written to a temporary
storage
Terminal Status
 Affects how messages with paging disposition are delivered to
the terminal
 2 options
– Paging Status
– Auto page Status

March 18,2000 BNG Version 2.0 40


Logical Message Building
Concepts & Terminology
Paging Status
 BMS delivers pages one at a time as the operator
requests them
 The terminal operator enters a “message retrieval
command”
 “page retrieval program” a component of BMS
retrieves the requested page from temporary
storage & displays it on the terminal

March 18,2000 BNG Version 2.0 41


Logical Message Building
Concepts & Terminology
Autopage status
 Entire message is delivered as soon as the terminal is ready
 Usually the output will be on a printer
Message Retrieval
 One page is displayed at a time
 Message retrieval commands are to be used for subsequent
pages
 First page gets displayed automatically when you invoke
CSPG transaction

March 18,2000 BNG Version 2.0 42


Logical Message Building
Concepts & Terminology
Message Retrieval Commands
P/n Retrieve page n
P/+n Retrieve the page that is n pages past the current
page
P/-n Retrieve the page that is n pages before the current
page
P/L Last page
P/N Next page
P/P Previous page
T/B Terminate the retrieval session & purge the messages
being displayed
March 18,2000 BNG Version 2.0 43
Logical Message Building

SEND TEXT
SEND TEXT Syntax
SEND TEXT
FROM(data-area)
LENGTH(data-value)
ACCUM
PAGING
ERASE
HEADER(data-area)
TRAILER(data-area)
March 18,2000 BNG Version 2.0 45
SEND TEXT Syntax
FROM Name of the field that contains the data to be
added to the logical message
LENGTH Length of the FROM field.
ACCUM Build a logical page
PAGING Pages to be written to temporary storage for
later retrieval under operator control
ERASE Erase terminal buffer as each page is sent
during page retrieval
HEADER Name of the field containing header
information
TRAILER Name of the field containing trailer information

March 18,2000 BNG Version 2.0 46


Controlling Vertical Spacing
 Inset new line character wherever vertical spacing is
needed (hex 15)
 Example
05 LINE-1.
10 FILLER PIC X(10) VALUE “Cust No”.
10 L1-CNO PIC X(6).
10 L1-NL PIC XX VALUE X’1515’.
 DFHBMPNL of DFHBMSCA can be used for initializing
L1-NL with new line character.

March 18,2000 BNG Version 2.0 47


Automatic Page Numbering
 Specify a non blank value in the third byte of the
prefix.
 This charcter is used as part of the header or trailer
message to indicate the position for displaying the
page number
 When an overflow condition occurs BMS scans the
header & trailer data & replaces this particular
character with the page number
 Maximum 5 bytes for page number
March 18,2000 BNG Version 2.0 48
SEND TEXT Example

SEND TEXT FROM(PRODUCT)


ACCUM
PAGING
ERSAE
HEADER (HD-AREA)
TRAILER (TR-AREA)

March 18,2000 BNG Version 2.0 49


SEND PAGE
 Ensures that the last page of data is written to
temporary storage even if it is not complete
 Specifies when the user can retrieve the message
by issuing retrieval commands
 It is mandatory after the last SEND TEXT
command
 Syntax:
 SEND PAGE OPERPURGE

March 18,2000 BNG Version 2.0 50


SEND PAGE
SEND PAGE [OPERPURGE]
[RETAIN | RELEASE]

OPERPURGE Operator must issue a message


termination to delete the logical message
RETAIN Control returns to the application program
when the user finishes viewing the message
RELEASE Control never returns to the program

March 18,2000 BNG Version 2.0 51


Logical Message Building

SEND MAP
Map Definition
Format
name DFHMDI SIZE=(lines,columns),
[LINE=line number | NEXT,]
[COLUMN=col.no,]
[JUSTIFY=FIRST | LAST,]
[HEADER=YES | TRAILER=YES]
Example
MAP4 DFHMDI SIZE=(2,80),
LINE=NEXT,
COLUMN=1,
TRAILER=YES
March 18,2000 BNG Version 2.0 53
Map Definition
Logical message consideration
 Line positioning is done mostly by making use of
LINE=NEXT
 Map positioning is done mostly by specifying
JUSTIFY=FIRST (normally for header map) or
JUSTIFY=RIGHT (normally for trailer map)
 JUSTIFY parameter controls the positioning of
header & trailer map
 HEADER & TRAILER parameters are used to
control overflow processing
March 18,2000 BNG Version 2.0 54
SEND MAP Command
Format
SEND MAP(map name)
[MAPSET(map set name)]
[FROM(data area)] [MAPONLY | DATAONLY]
[ACCUM] [PAGING] [ERASE]
Example
SEND MAP(‘MAP4)
MAPSET(‘MAPSET4)
FROM(LASTMAP4)
ACCUM PAGING ERASE

March 18,2000 BNG Version 2.0 55


Overflow Condition
 SEND MAP does not send HEADER & TRAILER automatically
 An OVERFLOW condition is raised when a detail map & the largest
trailer map will not fit into the current page
 The program should check the OVERFLOW condition & send the
trailer & header map
 While sending the header page,
– The page buffer is written into the temporary storage
– Page buffer is cleared
– Header map is sent
 The detail map should be sent again
 Not raised for HEADER & TRAILER map

March 18,2000 BNG Version 2.0 56


Comparison of SENDTEXT &
SEND MAP
SEND TEXT SEND MAP
 Header & Trailer sent  Program to check for
automatically overflow condition &
send Header & Trailer
 Has control over
 No control over overflow processing
overflow prcessing

March 18,2000 BNG Version 2.0 57


Printer Output
Printer Concepts
 The printer has a printer buffer similar to page
buffer. It is the intermediate storgae between the
host system & the printer’s print mechanism
 When the BMS page buffer is full, the message
is sent to the printer buffer
 The page overflow features can not be used. It
has to be done by keeping track of a line counter

March 18,2000 BNG Version 2.0 59


Printer Control Chacters
Form Feed
Used to skip to the top of the next page. Its hexa value is 0C . It occupies
the first position of the first line in the next page. It is printed as space.
New Line
Used to direct the printing to continue from the first position of the next
line.
Carriage Return
Same as New line, but paper does not advance to new page. Printing starts
from the 1 st column of the same page
End of Message
Marks the end of a page. It is taken care of by BMS

March 18,2000 BNG Version 2.0 60


SENDTEXT & SENDMAP
options
PRINT option
To activate the print mechanism
NLEOM option
Tells BMS to use new line & end of message control
characters while sending the data to the printer
FORMFEED option
Tells BMS that a form feed control character to be
inserted, in the first position of the Printer buffer
March 18,2000 BNG Version 2.0 61
Printing Considerations
 Overflow processing is to be done by the program.
Hence no need to specify HEADER & TRAILER
options
 FORMFEED option is to be used to skip pages
 PAGING option is not to be used if the message is
to be directly printed
 SEND PAGE is to be issued to force the last page
of the message to be sent

March 18,2000 BNG Version 2.0 62


Message Routing
ROUTE Command
Syntax
ROUTE LIST(data-name)
INTERVAL(hhmmss) | TIME(hhmmss)
[NLEOM]
Example
ROUTE LIST(ROUTE-LIST)
TIME(173000)

March 18,2000 BNG Version 2.0 64


ROUTE Command
01 ROUTE-LIST
05 LIST-ENTRY-1.
10 LE1-TERM-ID PIC X(4) VALUE ‘L1P1’.
10 FILLER PIC X(12) VALUE SPACES.
05 LIST-ENTRY-2.
10 LE2-TERMI-ID PIC X(4) VALUE ‘L2P3’.
10 FILLER PIC X(12) VALUE SPACES.
05 FILLER PIC S9(4) VALUE -1 COMP.

March 18,2000 BNG Version 2.0 65


RECEIVE Command
RECEIVE Command
Syntax
RECEIVE INTO(data-area)
LENGTH(data-area)
RESP(data-area)
Example
RECEIVE INTO(CMD-LINE)
LENGTH(CMD-LENGTH)
RESP(RESPONSE-CODE)
March 18,2000 BNG Version 2.0 67
SEND Command
SEND Command
Syntax
SEND FROM(data-name)
[LENGTH(data-value)]
[CTLCHAR(data-name)]
[ERASE]
Example
SEND FROM(CUST-DATA)
ERASE
March 18,2000 BNG Version 2.0 69
Day 2 - Session 2

Temporary Storage
&
Transient Data
Temporary Storage
Temporary Storage
 Temporary storage is divided into Temporary Storage
queues (TS Queues)
 Each TS queue can contain one or more records
 Each TS Queue is identified by a queue name (of 1 to 8
characters)
 Each record is assigned an item number
 Access could be
– Sequential (in item number sequence)
– Random (by specifying the item no)
 Records can be re-written

March 18,2000 BNG Version 2.0 72


WRITEQ TS Command
Syntax
WRITEQ TS QUEUE(name)
FROM(data-area)
LENGTH(data value)
[ITEM(data-area) | REWRITE]
[MAIN | AUXILIARY]
Example
WRITEQ TS QUEUE(TSQ-NAME)
FROM(TSQ-RECORD)
LENGTH(TSQ-LENGTH)
March 18,2000 BNG Version 2.0 73
READQ TS Command
Syntax
READQ TS QUEUE(name)
INTO(data-area)
LENGTH(data-area)
[ITEM(data-value) | NEXT]
Example
READQ TS QUEUE(TSQ-NAME)
INTO(TSQ-REC)
LENGTH(TSQ-LENGTH)
ITEM(TSQ-ITEM-NO)
RESP(RESP-CODE)
March 18,2000 BNG Version 2.0 74
DELETEQ TS Command
Syntax
DELETEQ TS QUEUE(NAME)
Example
DELETEQ TS QUEUE(TSQ-NAME)

 If a TS queue is not deleted after processing, it


exists indefinitely
 No provision to delete a single record
March 18,2000 BNG Version 2.0 75
Transient Data Queue
Transient Data Queue
(TD queue)
 TD queue is also called destinations
 TD queue should be defined in the Destination
Control Table (DCT). DCT contains the queue
name (or destination id) & the queue’s
characteristics
 Record gets deleted when it is read from the queue
 Two types of transient data queues
– Extra partition data queue
– Intra partirion data queue
March 18,2000 BNG Version 2.0 77
Extra partition transient data
queue
 Can be accessed by batch programs also
apart from CICS
 Mainly used for capturing data online &
process later by batch programs
 It is a sequential file (QSAM)
 It need not have to be in disk only; It can be
on tape also.
March 18,2000 BNG Version 2.0 78
Intra partition transient data
queue
 Most commonly used than extra partition data queue
 It is stored in a VSAM file named DFHNTRA. (all
queues)
 Provides a facility for Auomatic Transaction
Initiation (ATI).
– A triger level is defined in DCT & the corresponding
transaction
– When the number of records reach the triger level, the
transaction is initiated automatically

March 18,2000 BNG Version 2.0 79


WRITEQ TD Command
Syntax
WRITEQ TD QUEUE(name)
FROM(data-area)
[LENGTH(data-value)]
Example
WRITEQ TD QUEUE(‘L86P’)
FROM (PRINT-AREA)
March 18,2000 BNG Version 2.0 80
READQ TD Command
Syntax
READQTD QUEUE(name)
INTO(data-area)
[LENGTH(data-area)]
Example
READQTD QUEUE(‘L86P’)
INTO(PRINT-AREA)
LENGTH(PRT-LEN)
RESP(RESP-CODE)
March 18,2000 BNG Version 2.0 81
DELETEQ TD Command
Syntax
DELETEQ RD QUEUE(name)
Example
DELETEQ TD QUEUE(‘L86P’)
 Though the records are delelted on completion of the read
opertaion, the space occupied by the queue is not release.
Hence it can be deleted to release the space.
 DCT entry is not removed
 DELETEQ command is not valid for extra partition
destination
March 18,2000 BNG Version 2.0 82
Day 3 - Session 1

Interval Control
and
Task Control
Interval Control
ASKTIME Command
Syntax
ASKTIME [ABSTIME(data-area)]

ABSTIME 15 byte packed decimal field where CICS


places an abslute time value representing
the number of milliseconds that have elapsed
since Jan 1 1900
Example
ASKTIME ABSTIME(ABSOLUTE-TIME)

March 18,2000 BNG Version 2.0 85


FORMATTIME command
FORMATTIME ABSTIME(data-area)
[DATE(data-area) [DATEFORM(data-area)]]
[MMDDYY(data-area)]
[DDMMYY(data-area)]
[YYMMDD(date-area)]
[YYDDMM(data-area)]
[YYDD(data-area)]
[DATESEP[(data-value)]]
[DAYCOUNT(data-area)]
[DAYOFWEEK(data-area)]
[DAYOFMONTH(data-area)]
[MONTHOFYEAR(data-area)]
[YEAR(data-area)]
[TIME(data-area)
[TIMESEP[(data-value)]]

March 18,2000 BNG Version 2.0 86


FORMATTIME command
ABSTIME Data area containing the absolute time
DATE Date formated in installation specific form
DATEFORM Installation standard is returned
MMDDYY Date in MMDDYY Format
DDMMYY Date in DDMMYY Format
YYMMDD Date in YYMMDD format
YYDDMM Date in YYDDMM format
YYDDD Date in YYDDD format
DATESEP Separator between day, month & year
March 18,2000 BNG Version 2.0 87
FORMATTIME command
DAYCOUNT No of days from Jan 1 1900
DAYOFWEEK The number that corresponds to the day
of the week
DAYOFMONTHDay in the current month
MONTHOFYEAR Number that corresponds to the
month in current year
YEAR full year (4 digits)
TIME Time in hhmmsss format
TIMESEP Separator used for time

March 18,2000 BNG Version 2.0 88


START Command
START TRANSID(name)
INTERVAL(hhmmss) TIME(hhmmss)
AFTER [HOURS(hh)] [MINUTES(mins)]
[SECONDS(secs)]
AT [HOURS(hh)] [MINUTES(mins)]
[SECONDS(secs)]
[TERMID(name)]
[FROM(data-area) [LENGTH(data-value)]]
[RTERMID(name)] [RTRANSID(name)]
[QUEUE(name)] [REQID(name)]

March 18,2000 BNG Version 2.0 89


March 18,2000 BNG Version 2.0 90
RETRIEVE COMMAND

Syntax
RETRIEVE INTO(data area)
[LENGTH(data-area)]
[RTRANSID(name)]
[RTERMID{name)]
[QUEUE(name)]

March 18,2000 BNG Version 2.0 91


CANCEL Command
CANCEL REQID(name)

REQIDSpecifies the 8 byte value that


identifies the START command
to be canceled

March 18,2000 BNG Version 2.0 92


Task Control
SUSPEND Command
SUSPEND

March 18,2000 BNG Version 2.0 94


ENQ Command
ENQ RESOURCE(data area)
LENGTH(data value)

RESOURCE 1 to 255 byte long character


string that identifies the resource to be
ENQed
LENGTH Length of the RESOURCE field.
Half word binary
March 18,2000 BNG Version 2.0 95
DEQ Command
DEQ RESOURCE(data area)
LENGTH(data value)

RESOURCE 1 to 255 byte long character


string that identifies the resource to be
DEQed
LENGTH Length of the RESOURCE field.
Half word binary
March 18,2000 BNG Version 2.0 96
Day 4 - Session 1

Error Processing
ABEND Processing
HANDLE ABEND Command
Syntax
HANDLE ABEND PROGRAM(name) |
LABEL(proc-name) |
CANCEL
RESET
Example
HANDLE ABEND PROGRAM(‘ABEND1’)

March 18,2000 BNG Version 2.0 99


ABEND Command
Syntax
ABEND [ABCODE(data-value)]
[CANCEL]
Example
ABEND ABCODE(‘X100’)
CANCEL

March 18,2000 BNG Version 2.0 100


Recovery Processing
Recovery Processing
 Logging
 Dynamic Transaction Backout
 Emergency Restart
 Logical Unit of Work
 SYNCPOINT Command

March 18,2000 BNG Version 2.0 102


Day 4 - Session 2

Error Processing (contd)


Journal Control
WRITE JOURNALNUM
Command
WRITE JOURNALUM(data-value)
JTYPEID(data-value)
FROM(data-area)
[LENGTH(data-value)]
[WAIT]
[REQID(data-area)]
[STARTIO]
[PREFIX(data-area)
[PFXLENG(data-value]]
March 18,2000 BNG Version 2.0 105
WAIT JOURNALNUM
Command
WAIT JOURNALNUM(data-value)
[REQID(data-area)]
[STARTIO]

March 18,2000 BNG Version 2.0 106


Day 5 - Session 1

Inter communication
Inter Communication
 Transaction Routing
 Function Shipping
 Distributed Program Link
 Asynchronous Processing
 Distributed Transaction Processing

March 18,2000 BNG Version 2.0 108


Communication Mechanisms
 Multi Region Operation (MRO)
– InterRegion Communication Access Method
• Unique to CICS
• Depends on Supervisor Calls
– Cross-Memory Services
• Data exchanged directly between address spaces
• No overhead of supervisor call
 Interystem Communication (ISC)
– Connected through VTAM
March 18,2000 BNG Version 2.0 109
Transaction Routing
 A terminal owned by one CICS system run a transaction in
some other system
 PCT Entry in TOR
DFHPCT TYPE=REMOTE,
TRANSID=INQ1,
SYSIDENT=CTSC
 PCT Entry in AOR
DFHPCT TYPE=ENTRY
TRANSID=INQ1
PROGRAM=CUSTINQ
March 18,2000 BNG Version 2.0 110
Transaction Routing
 CEDF expects the transaction to be owned by the
same system
 To avoid this
– The terminal should be defined as a remote terminal
in AOR
– CRTE transaction should be initiated as
CRTESYSID=CTSC
– To end the about routing transaction (CRTE)
CANCEL command should be entered
March 18,2000 BNG Version 2.0 111
Function Shipping
 A program in one CICS system access
resources owned by another CICS system.
 Supported Resources
– VSAM files
– Transient Data Destinations
– Temporary Storage queues
– IMS data basses

March 18,2000 BNG Version 2.0 112


Function Shipping
FCT Entry in AOR
DFHFCT TYPE=REMOTE
DATABASE=CUSTMAS
SYSIDNT=CTSC
LRECL=80
KEYLEN=4
FCT Entry in FOR
DFHFCT TYPE=DATASET
DATASSET=CUSTMAS
ACCMETH=(VSAM,KSDS)
SERVREQ=(BROWSE,DELETE,UPDATE)
RECFORM=(FIXED,BLOCKED)

March 18,2000 BNG Version 2.0 113


Function Shipping
SYSID in CICS commands
READ DATASET(‘CUSTMAS’)
INTO(CUST-REC)
RIDFLD(CUST-NO)
SYSID(‘CTSC’)
LENGTH(CMAS-LEN)
KEYLENGTH(4)
RESP(RESP-CODE)
March 18,2000 BNG Version 2.0 114
Distributed Program Link
 A program running in one CICS system can
issue a LINK command that invokes a
program in another CICS system
 Easy way to implement client-server
applications
 Can be used to avoid long sequence of
function shipping requests

March 18,2000 BNG Version 2.0 115


Distributed Program Link
Format of LINK command
LINK PROGRAM(name)
[COMMAREA(data-vaue)
[LENGTH(data-value)]]
[SYSID(system name)]
[SYNCONRETURN]

March 18,2000 BNG Version 2.0 116


Asynchronous Processing
 Distributed START command.
 START command includes a SYSID option or the
PPT of the transaction table specifies a remote
system.
 All the START command options can be used.
 The task that issued the START command & the
started task are treated as separate LUW. If one
fails, the other is not affected.

March 18,2000 BNG Version 2.0 117


Distributed Transaction
Processing
 2 or more programs running on different
systems communicate with each other. This
is called conversation
 The program that initiates the transaction is
called front end
 The other program is called back end
 This is CICS implementation of APPC

March 18,2000 BNG Version 2.0 118


THANK YOU

You might also like