Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 21

Mainframe230

HomeFree Questions
Showing posts with label Mainframe Tutorials. Show all posts
RESETBR Command in cics
The RESETBR command
EXEC CICS
RESETBR DATASET(file-name)
RIDFLD(data-area)
[ RRN | RBA ]
[ GTEQ | EQUAL ]
[ KEYLENGTH(data-value) [ GENERIC ] ]
[ REQID(data-value) ]
[ SYSID(name) ]
END-EXEC
Options
DATASET Specifies the file name as defined using CEDA DEFINE FILE(file-name) GRO
UP(group-name)
RIDFLD For a KSDS specifies the key of the record where the browse
Will start. For a RRDS it specifies the relative record number and for an ESDS i
t specifies the RBA (PIC S9(8) COMP). If RRN or RBA is not specified, key is ass
umed.
RRN Specifies that the file is a RRDS and the RIDFLD should be interpreted as a
relative record number.
RBA Specifies that the file is an ESDS and the RIDFLD should be interpreted as a
Relative Byte Address.
GTEQ Specifies that the browse operation will start with a record whose key is g
reater than or equal to the RIDFLD.
EQUAL Specifies that the browse operation will start with a record whose key is
equal to the RIDFLD.
GENERIC Specifies that only a part of the key (left part, whose length is indica
ted by KEYLENGTH) is supplied in the RIDFLD. The first record that matches this
key is the point of start of the browse.
KEYLENGTH is a PIC S9(4) COMP field that specifies the length of the generic key
. The value must be less than the length of the key defined for the file. Also n
eeded if SYSID is specified. Not valid if RBA or RRN is specified.
REQID Specifies a binary half word or literal value that identifies this browse
operation. Useful when more than one browse is started on same file. You can the
n explicitly direct further browse operations to a specific operation.
SYSID Specifies a 1 to 4 character connection name that represents a remote syst
em.
Conditions
The RESP field can have the following values:DISABLED file is disabled using CEMT SET

DSIDERR File is not defined to CICS


ILLOGIC A serious VSAM error occurred
INVREQ The browse operation was not started on this file or the KEYLENGTH is inv
alid.
IOERR An IOERR occurred
NOTAUTH The transactions definition specified resource Checking and the operator
is not authorized to Access the data set.
NOTFND The specified record could not be located.
NOTOPEN the data set is not open
SYSIDERR The system identified by SYSID could not be found.
Notes
You can issue RESETBR only after a STARTBR.
To browse via a alternate index specify a path name for the data set when you de
fine the file.
You can skip records when browsing simply by changing the RIDFLD value when you
browse using READNEXT or READPREV on the file. This is called skip sequential pr
ocessing. This is an alternative to using RESETBR.
RESETBR has the same effect as issuing an ENDBR and a STARTBR. However if you ta
ke this path, the VSAM resources (string) is released and then reacquired when y
ou issue STARTBR. For this reason RESETBR is more efficient. However, your progr
am could go into a string wait!!.
Get FREE Mainframe Interview Question & Answers - Click Here
Posted by M siva raman at Monday, November 08, 2010 0 comments
Labels: CICS, CICS Tutorial, Entire Mainframe Materials, Mainframe Tutorials
READNEXT Command and READPERV Command in cics
The READNEXT command
EXEC CICS
READNEXT { DATASET(name) | FILE(name) }
{ INTO(data-area) | SET(pointer-ref) }
[ LENGTH(data-area) ]
RIDFLD(data-area)
[ KEYLENGTH(data-value) ]
[ RBA | RRN ]
[ REQID(data-value) ]
[ SYSID(name) ]
END-EXEC
Options
DATASET or FILE Specifies a 1 to 8 character name for the dataset as specified u
sing CEDA DEFINE FILE(name)
INTO The target data area
SET Specifies a pointer data item (or register) to hold the address of the data
record
LENGTH Specifies in a half word PIC S9(4) COMP field. This is an input / output
field. On input it specifies the length of the data area. On return CICS sets in
to this field the length of the data returned. Required if you are dealing with
variable length records.

RIDFLD If RRN or RBA is specified refers to relative record number of a RRDS or


RBA of a ESDS file. If neither is specified this field contains the key of the K
SDS record. This field must be as big as the full key length. It is an input / o
utput field. If you set it with a value CICS uses the value to fetch the right r
ecord, skipping any records in the process while moving from the current positio
n (skip sequential processing). Note that for skip sequential processing the key
you set for READNEXT must be higher than what was returned in the previous call
. If you specified EQUAL in the start browse command and CICS cannot find the re
cord, it returns NOTFND. If GTEQ was specified while starting the browse, CICS r
eturns the first record with a higher key than what you specified. CICS always s
ets the field with the full key of the record just read.
KEYLENGTH Specifies in a half word field ( PIC S9(4) COMP) field the length of t
he generic key. It has meaning if the browse was started(STARTBR), or reset(RESE
TBR) with the GENERIC keyword. Valid only for a KSDS and therefore invalid if th
e RRN or RBA keywords are specified. Also needed if SYSID is specified.
RBA Full word PIC S9(8) COMP field which specifies the relative byte address of
the record for a KSDS or ESDS file.
RRN Full word PIC S9(8) COMP field which specifies the relative record number of
the record for a RRDS file.
REQID Specifies a binary half word or literal value that identifies the browse o
peration. Useful when more than one browse is started on same file. You can then
explicitly direct further browse operations to a specific operation.
SYSID Specifies a 1 to 4 character connection name that represents a remote syst
em.
Conditions:
The RESP field can have the following values:DISABLED file is disabled using CEMT SET
DSIDERR File is not defined to CICS. In later systems also indicated by FILENOTF
OUND.
LENGERR The buffer provided is too small to hold the record.
DUPKEY Occurs when you READNEXT via an alternate index to indicate that at least
one more record with the same key exists. Issue READNEXT calls repeatedly until
you don t get the DUPKEY condition to fetch all records with the same key.
ENDFILE End of file condition.
ILLOGIC A serious VSAM error occurred
INVREQ The browse operation was not started by a STARTBR command, the meaning of
the RIDFLD (RBA, RRN, Key) was changed in between the browse operation, or the
KEYLENGTH is incorrect.
IOERR An IOERR occurred
NOTAUTH The transactions definition specified resource Checking and the operator
is not authorized to Access the data set.
NOTFND The specified record could not be located.
NOTOPEN the data set is not open

SYSIDERR The system identified by SYSID could not be found.


Notes
You must issue STARTBR before issuing this command. Note that each STARTBR holds
a VSAM string.
You cannot update a file using a browse operation. (exception is if the file is
under RLS).
For browsing via an alternate index specify the PATH name in the data set option
when you define the file using CEDA. Check for the DUPKEY condition if the file
permits duplicate alternate keys. The order of records are not assured to be in
prime key sequence.
DUPKEY (if accessing via a PATH) or ENDFILE are the only conditions you should e
xpect to handle in your program.
The READPREV command
EXEC CICS
READPREV { DATASET(name) | FILE(name) }
{ INTO(data-area) | SET(pointer-ref) }
[ LENGTH(data-area) ]
RIDFLD(data-area)
[ KEYLENGTH(data-value) ]
[ RBA | RRN ]
[ REQID(data-value) ]
[ SYSID(name) ]
END-EXEC
Options
DATASET or FILE Specifies a 1 to 8 character name for the data set as specified
using CEDA DEFINE FILE(name)
INTO The target data area
SET Specifies a pointer data item (or register) to hold the address of the data
record
LENGTH Specifies in a half word PIC S9(4) COMP field. This is an input / output
field. On input it specifies the length of the data area. On return CICS sets in
to this field the length of the data returned. Required if you are dealing with
variable length records.
RIDFLD If RRN or RBA is specified
RBA of a ESDS file. If neither is
SDS record. This field must be as
he field with the full key of the

refers to relative record number of a RRDS or


specified this field contains the key of the K
big as the full key length. CICS always sets t
record just read.

KEYLENGTH Specifies in a half word field ( PIC S9(8) COMP) field the length of t
he generic key. It has meaning if the browse was started, or reset with the GENE
RIC keyword. Valid only for a KSDS and therefore invalid if the RRN or RBA keywo
rds are specified. If RIDFLD and KEYLENGTH is set by the application and the bro
wse was started with the GENERIC option, CICS repositions the browse using the n
ew generic key.
RBA Full word PIC S9(8) COMP field which specifies the relative byte address of
the record for a KSDS or ESDS file.
RRN Full word PIC S9(8) COMP field which specifies the relative record number of
the record for a RRDS file.
REQID Specifies a binary half word or literal value that identifies this browse

operation. Useful when more than one browse is started on same file. You can the
n explicitly direct further browse operations to a specific operation.
SYSID Specifies a 1 to 4 character connection name that represents a remote syst
em.
Conditions:
The RESP field can have the following values:DISABLED file is disabled using CEMT SET
DSIDERR File is not defined to CICS. In later systems also indicated by FILENOTF
OUND.
LENGERR The buffer provided is too small to hold the record.
DUPKEY Occurs when you READPREV via an alternate index to indicate that at least
one more record with the same key exists. To fetch all records with the same ke
y, issue READPREV calls repeatedly until you don t get the DUPKEY condition.
ENDFILE End of file condition.
ILLOGIC A serious VSAM error occurred
INVREQ A browse operation was not started by a STARTBR command, the meaning of t
he RIDFLD (RBA, RRN, key) was changed during the browse operation, or the KEYLEN
GTH is invalid.
IOERR An IOERR occurred
NOTAUTH The transactions definition specified resource Checking and the operator
is not authorized to Access the data set.
NOTFND The specified record could not be located.
NOTOPEN the data set is not open
SYSIDERR The system identified by SYSID could not be found.
Notes:
You must issue STARTBR before issuing this command. Note that each STARTBR holds
a VSAM string.
You cannot update a file using a browse operation.
For browsing via an alternate index specify the PATH name in the data set option
when you define the file using CEDA. Note that DUPKEY conditions are possible w
hen browsing via an alternate index.
DUPKEY (if accessing via a PATH) or ENDFILE are the only conditions you should e
xpect to handle in your program.
If you issue READPREV immediately after READNEXT the same record is fetched agai
n.
At STARTBR position at the end of the file (by moving high values into the RIDFL
D) before issuing this command if you want to read this file backwards.
Get FREE Mainframe Interview Question & Answers - Click Here
Posted by M siva raman at Monday, November 08, 2010 0 comments
Labels: CICS, CICS Tutorial, Entire Mainframe Materials, Mainframe, Mainframe Tu
torials
Browser commands in cics - STARTBR Command
The STARTBR command

EXEC CICS
STARTBR DATASET(file-name)
RIDFLD(data-area)
[ RRN | RBA ]
[ GTEQ | EQUAL ]
[ GENERIC ]
[ KEYLENGTH(data-value) ]
[ REQID(data-value) ]
[ SYSID(name) ]
END-EXEC
Options:
DATASET Specifies the file name as defined using CEDA DEFINE FILE(file-name) GRO
UP(group-name)
RIDFLD For a KSDS specifies the key of the record where the browse
Will start. For a RRDS it specifies the relative record number and for an ESDS i
t specifies the RBA (PIC S9(8) COMP).
RRN Specifies that the file is a RRDS and the RIDFLD should be interpreted as a
relative record number.
RBA Specifies that the file is an ESDS and the RIDFLD should be interpreted as a
Relative Byte Address.
GTEQ Specifies that the browse operation will start with a record whose key is g
reater than or equal to the RIDFLD.
EQUAL Specifies that the browse operation will start with a record whose key is
equal to the RIDFLD.
GENERIC Specifies that only a part of the key (left part, whose length is indica
ted by KEYLENGTH) is supplied in the RIDFLD. The first record that matches this
key is the point of start of the browse.
KEYLENGTH is a PIC S9(4) COMP field that specifies the length of the generic key
. The value must be less than the length of the key defined for the file.
REQID Specifies a binary half word or literal value that identifies this browse
operation. Useful when more than one browse is started on same file. You can the
n explicitly direct further browse operations to a specific browse instance.
SYSID Specifies a 1 to 4 character connection name that represents a remote syst
em.
Conditions:
The RESP field can have the following values:DISABLED file is disabled using CEMT SET
DSIDERR File is not defined to CICS
ILLOGIC A serious VSAM error occurred
INVREQ The browse operation is not enabled for this File when it was defined usi
ng CEDA, the REQID already exists, the KEYLENGTH value is incorrect, or the file
is a user maintained table.
IOERR An IOERR occurred

NOTAUTH The transactions definition specified resource Checking and the operator
is not authorized to Access the data set.
NOTFND The specified record could not be located.
NOTOPEN the data set is not open
SYSIDERR The system identified by SYSID could not be found.
Notes:
You must issue a STARTBR command before you issue READNEXT or READPREV.
To browse via a alternate index specify a path name for the data set when you de
fine the file.
You need to define a string for each browse operation. A string is in this case
one index and one data buffer. The string is held right from STARTBR to ENDBR.
You can skip records when browsing simply by changing the RIDFLD value when you
browse using READNEXT or READPREV on the file. This is called skip sequential pr
ocessing. You can also do this by RESETBR but with this command the string resou
rce is released and reacquired. There is therefore a possibility of the transact
ion going into string wait.
CICS sets the data area corresponding to the RIDFLD field with the key of the re
cord fetched using READNEXT or READPREV.
In the case of a KSDS you can start at the beginning of the file by moving low v
alues to the RIDFLD when you issue STARTBR. If you have defined a numeric key fi
eld, move zeroes to the key field, as the compiler wont allow you to move low va
lues to the key field. In the case of an ESDS move 0 to the RIDFLD. In the case
of a RRDS move 1 to the RIDFLD.
To start the browse at the end of a file, for a KSDS move high values (X FF ) to the
RIDFLD. High values is a special case, it does not cause a NOTFND condition. Un
fortunately moving all 9 s to a numeric key field will cause a NOTFND condition if
the record is not found. In this case redefine the field as a alphanumeric fiel
d and move high values to it to start the browse at the end of the file. For an
ESDS or a RRDS move HIGH VALUES to the RIDFLD.
To start a browse at a specific record that must exist in the file, code the EQU
AL keyword and move the key of the record to the RIDFLD.
Get FREE Mainframe Interview Question & Answers - Click Here
Posted by M siva raman at Monday, November 08, 2010 0 comments
Labels: CICS, CICS Tutorial, Entire Mainframe Materials, Mainframe, Mainframe Tu
torials
What is Browser in cics?
Browsing
Accessing files sequentially is called browsing. The commands that are needed fo
r browsing are:STARTBR
READNEXT
READPREV
RESETBR
ENDBR
You can browse a KSDS, RRDS or ESDS. Browsing a KSDS is on key sequence. For an
RRDS it is based on relative record numbers. For an ESDS it is based on RBA.
Get FREE Mainframe Interview Question & Answers - Click Here
Posted by M siva raman at Monday, November 08, 2010 0 comments
Labels: CICS, CICS Tutorial, Entire Mainframe Materials, Mainframe, Mainframe Ti
ps, Mainframe Tutorials
Mainframe Tutorial-CICS File Control Commands-DELETE Command

The DELETE command


EXEC CICS
{ DELETE DATASET(filename) | FILE(name) }
[ RIDFLD(data-area)
[ KEYLENGTH(data-value)
[ GENERIC
[ NUMREC(data-area) ] ] ] ]
[ RBA | RRN ]
[ SYSID(name) ]
END-EXEC
Options:
DATASET or FILE Specifies a 1 to 8 character name for the datset as specified us
ing CEDA DEFINE FILE(name)
RIDFLD Specifies a data area that has the key of the record to be deleted. If om
itted, the record must have been fetched using a READ with the UPDATE option. If
RRN or RBA is not specified this field contains the key of the KSDS record to b
e deleted.
KEYLENGTH A binary half word (PIC S9(4) COMP) field used to specify the length o
f a GENERIC key. Used for a generic delete along with the GENERIC option. This f
ield must be specified along with SYSID option. Not valid if RBA or RRN is speci
fied.
GENERIC Specifies that the delete is a generic delete.
NUMREC Is set by CICS to the number of records that have been deleted for a gene
ric delete.
RBA Specifies that the RIDFLD contains a RBA for a VSAM KSDS record. It is a bin
ary full word field PIC S9(8) COMP.
RRN Specifies that the RIDFLD contains a RRN for a VSAM RRDS record. It is a bin
ary full word field PIC S9(8) COMP. Note that RRN s start from 1.
SYSID Specifies a 1 to 4 character connection name that represents a remote syst
em.
Conditions:
The RESP field can have the following values:DISABLED file is disabled using CEMT SET
DSIDERR File is not defined to CICS. In later systems also indicated by FILENOTF
OUND.
DUPKEY Another record with the specified key also exists in the file when the fi
le access is via an alternate index. The DELETE deletes only the first record.
ILLOGIC A serious VSAM error occurred
INVREQ The DELETE operation is not enabled for this File when it was defined usi
ng CEDA. It can also occur if the RIDFLD is not specified and the DELETE was not
preceded by a READ with the UPDATE option.
IOERR An IOERR occurred
NOTAUTH The transaction s definition specified resource Checking and the operator

is not authorized to Access the data set.


NOTOPEN the data set is not open
NOTFND The specified record could not be found.
SYSIDERR The system identified by SYSID could not be found.
Notes
For recoverable files, the DELETE command causes your task to hold the control i
nterval that contains the record until you take a syncpoint or your task ends.
To prevent deadlock situations, follow two rules:-(1)update files in alphabetica
l order and (2) update records in ascending key sequence.
You can delete a record directly or subsequent to a READ with the UPDATE option.
You can get an exception of NOTFND if you do a DELETE with RIDFLD and the specif
ied record does not exist. You can also get a DUPKEY if deleting via a path and
duplicate alternate keys are permitted and exist.
Get FREE Mainframe Interview Question & Answers - Click Here
Posted by M siva raman at Sunday, November 07, 2010 0 comments
Labels: CICS, CICS Tutorial, Entire Mainframe Materials, Mainframe, Mainframe Tu
torials
Mainframe Tutorial-CICS File Control Commands-REWRITE Command
The REWRITE command
EXEC CICS
{ REWRITE DATASET(filename)|FILE(name) }
FROM(data-area)
[ LENGTH(data-area) ]
[ SYSID(name) ]
END-EXEC
Options:
DATASET or FILE Specifies a 1 to 8 character name for the dataset as specified u
sing CEDA DEFINE FILE(name)
FROM The source data area
LENGTH Specifies in a half word PIC S9(4) COMP field. This specifies the length
of the record to be written. Not needed for fixed length records. Required if SY
SID is specified.
SYSID Specifies a 1 to 4 character connection name that represents a remote syst
em.
Conditions:
The RESP field can have the following values:DISABLED file is disabled using CEMT SET
DSIDERR File is not defined to CICS. In later systems also indicated by FILENOTF
OUND.
DUPREC Occurs if the record contains an alternate key value that already exists,
the alternate index does not allow duplicate keys and the alternate index is pa
rt of the files upgrade set or access is via the path.
ILLOGIC A serious VSAM error occurred
INVREQ The record was not previously fetched by READ with UPDATE option.

IOERR An IOERR occurred


NOTAUTH The transaction s definition specified resource Checking and the operator
is not authorized to Access the data set.
NOTOPEN the data set is not open
SYSIDERR The system identified by SYSID could not be found.
Notes:
To REWRITE a record you must first read it with UPDATE option. If the file is re
coverable, the lock on the CI is held until the task ends or a syncpoint is take
n. Else the lock is released when you issue a REWRITE or UNLOCK command.
When you rewrite a record, you can change any field except the key field, or cha
nge the length of the record.
Get FREE Mainframe Interview Question & Answers - Click Here
Posted by M siva raman at Sunday, November 07, 2010 0 comments
Labels: CICS, CICS Tutorial, Entire Mainframe Materials, Mainframe, Mainframe Tu
torials
Mainframe Tutorial-CICS File Control Commands-WRITE Command
The WRITE command
EXEC CICS
{ WRITE DATASET(filename) | FILE(name) }
FROM(data-area)
[ LENGTH(data-area) ]
RIDFLD(data-area)
[ KEYLENGTH(data-value) ]
[ SYSID(name) ]
[ RRN | RBA ]
[ MASSINSERT ]
END-EXEC
Options
DATASET or FILE Specifies a 1 to 8 character name for the datset as specified us
ing CEDA DEFINE FILE(name)
FROM The source data area
LENGTH Specifies in a half word PIC S9(4) COMP field. This specifies the length
of the record to be written. Not needed for fixed length records.
RIDFLD If RRN or RBA is specified refers to relative record number of a RRDS or
RBA of a ESDS file. If neither is specified this field contains the key of the K
SDS record.
KEYLENGTH Specifies in a half word field ( PIC S9(8) COMP) field the length of t
he key. It is used only if SYSID is specified and RBA / RRN is not specified, in
other words a remote KSDS file.
SYSID Specifies a 1 to 4 character connection name that represents a remote syst
em.
RBA Full word PIC S9(8) COMP field which specifies the relative byte address of
the record for a KSDS or ESDS file.
RRN Full word PIC S9(8) COMP field which specifies the relative record number of
the record for a RRDS file.
MASSINSERT Specifies that the write is part of a VSAM mass insert operation. A m
ass insert operation splits the CI at the key of the record being inserted, whic

h improves mass sequential inserts.


Conditions
The RESP field can have the following values:DISABLED file is disabled using CEMT SET
DSIDERR File is not defined to CICS. In later systems also indicated by FILENOTF
OUND.
LENGERR The buffer provided is too small to hold the record.
DUPREC A record with the specified key already exists in the file. Can also occu
r if the record contains an alternate key value that already exists, the alterna
te index does not allow duplicate keys and the alternate index is part of the fi
les upgrade set or access is via the path.
ILLOGIC A serious VSAM error occurred
INVREQ The write operation is not enabled for this File when it was defined usin
g CEDA , or the key length specified is incorrect, or a READ UPDATE has exclusiv
e control of this record.
IOERR An IOERR occurred
NOTAUTH The transaction s definition specified resource Checking and the operator
is not authorized to Access the data set.
NOTOPEN the data set is not open
SYSIDERR The system identified by SYSID could not be found.
Notes
When you write to an ESDS the record is always added to the end of the file. The
input via RIDFLD is ignored. On return though, it has the RBAS of the record th
at has just been added.
If you are inserting several records in key sequence, use massinsert. It is more
efficient. You need to take a SYNCPOINT or issue an UNLOCK command before the r
ecords can be read by any task.
The only exception condition that you normally can expect to handle in your prog
ram is DUPREC.
Get FREE Mainframe Interview Question & Answers - Click Here
Posted by M siva raman at Sunday, November 07, 2010 0 comments
Labels: CICS, CICS Tutorial, Entire Mainframe Materials, Mainframe, Mainframe Tu
torials
Mainframe Tutorial-File Control Commands-READ Command
File Control Commands
The READ command
EXEC CICS
{ READ DATASET(filename) | FILE(name) }
{ INTO(data-area) | SET(pointer-ref) }
[ LENGTH(data-area) ]
RIDFLD(data-area)
[ KEYLENGTH(data-value) [ GENERIC ]]
[ SYSID(name) ]
[ RRN | RBA ]
[ GTEQ | EQUAL ]
[ UPDATE ]
END-EXEC

Options
DATASET or FILE Specifies a 1 to 8 character name for the data set as specified
using CEDA DEFINE FILE(name)
INTO The target data area
SET Specifies a pointer data item (or register) to hold the address of the data
record
LENGTH Specifies in a half word PIC S9(4) COMP field. This is an input / output
field. On input it specifies the length of the data area. On return CICS sets in
to this field the length of the data returned. Required if you are dealing with
variable length records.
RIDFLD If RRN or RBA is specified refers to relative record number of a RRDS or
RBA of a ESDS file. If neither is specified this field contains the key of the K
SDS record. This field must be as big as the full defined key length. After a ge
neric read, CICS always sets the field with the full key of the record just read
. For this reason the length of the field should be the full key length.
KEYLENGTH Specifies in a half word field ( PIC S9(4) COMP) or a literal, the len
gth of the generic key. The value specified must be less than the files defined
key length. Used only with GENERIC or SYSID option. Valid only for a KSDS and th
erefore invalid if the RRN or RBA keywords are specified.
GENERIC Specifies that only a part of the key (left part, whose length is indica
ted by KEYLENGTH) is supplied in the RIDFLD. The first record with a key whose l
eftmost positions(as many as specified by this field) match the RIDFLD is return
ed.
SYSID Specifies a 1 to 4 character connection name that represents a remote syst
em.
RBA Full word PIC S9(8) COMP field which specifies the relative byte address of
the record for a KSDS or ESDS file.
RRN Full word PIC S9(8) COMP field which specifies the relative record number of
the record for a RRDS file.
GTEQ Specifies that the first record whose key equal to or higher than what is s
pecified in the RIDFLD will be returned to the application.
EQUAL Specifies that only a record whose key exactly matches the value in the RI
DFLD will be returned to the application.
UPDATE Specifies that you Intend to update the record by rewriting or deleting i
t. CICS locks the whole CI containing the record and does not allow any other ta
sk access to this CI until one of the following occurs:1) you issue a REWRITE, D
ELETE or UNLOCK command or 2)additionally if the file is defined as recoverable
you have to issue a syncpoint or your task must end (implied syncpoint).
Conditions:
The RESP field can have the following values:DISABLED file is disabled using CEMT SET
DSIDERR File is not defined to CICS. In later systems also indicated by FILENOTF
OUND.

LENGERR The buffer provided is too small to hold the record.


DUPKEY Occurs when you READ via an alternate index and indicate that at least on
e more record with the same key exists. The read command fetches only the first
record with the same key.
ENDFILE End of file condition.
ILLOGIC A serious VSAM error occurred.
INVREQ The read request is prohibited by the resource definition for this resour
ce.
IOERR An IOERR occurred
NOTAUTH The transactions definition specified resource Checking and the operator
is not authorized to Access the data set.
NOTFND The specified record could not be located.
NOTOPEN the data set is not open
SYSIDERR The system identified by SYSID could not be found.
Notes:
To read from an alternate index specify the PATH name instead of the file name w
hen you define the file using CEDA. Only the first of many records with the same
key can be read by the READ command. If you want to read all records with the s
ame key you must use READNEXT.
If accessing via an alternate index DUPKEY is possible if the alternate key is n
ot unique. The other exception condition you can get is NOTFND if you do not fin
d a record with the same key.
Get FREE Mainframe Interview Question & Answers - Click Here
Posted by M siva raman at Sunday, November 07, 2010 0 comments
Labels: CICS, CICS Tutorial, Entire Mainframe Materials, Mainframe, Mainframe Tu
torials
DeletQ TS Command (TSQ)
The DELETQ TS command
EXEC CICS
DELETQ TS QUEUE(name)
[ SYSID(name) ]
END-EXEC
QUEUE One to eight character queue name.
SYSID Connection name of the remote system where this queue is defined.
Exceptions
INVREQ The queue was created for CICS internal use and cannot be written into by
a user program.
ISCINVREQ An undeterminable error occurred on the remote system that has the que
ue.
QIDERR The specified queue does not exist.
SYSIDERR The system defined by SYSID could not be located or accessed.
Notes
TS queues are automatically created when you write a record to a queue that does

not exist. Once created they have to be explicitly deleted using the DELETQ com
mand.
Queues can be created in virtual storage or via DFHTEMP in a vsam ESDS file.
You can create a unique queue name by using the value in EIBTRMID field of the E
IB.
Another way to delete a queue is to issue CEBR and issue a purge command. Since
queues can be deleted so easily, checking of QIDERR is a must.
Get FREE Mainframe Interview Question & Answers - Click Here
Posted by M siva raman at Tuesday, November 02, 2010 0 comments
Labels: CICS, CICS Tutorial, Entire Mainframe Materials, Mainframe, Mainframe Tu
torials
ReadQ TS Command (TSQ)
The READQ TS command
EXEC CICS
READQ TS QUEUE(name)
{ INTO(data-area) | SET(pointer-ref) }
[ LENGTH(data-value) ]
[ NUMITEMS(data-value) ]
[ ITEM(data-area) | NEXT ]
[ SYSID(name) ]
END-EXEC
options
QUEUE One to eight character queue name.
INTO The data area into where the data from the queue is to be written.
SET Specifies the data area that will contain the address of the retrieved recor
d.
LENGTH A binary half word PIC S9(4) COMP field that on input specifies the lengt
h of the data area and on return from the call has the length of the record that
has been read.
ITEM A half word PIC S9(4) COMP field which specifies the item to be read from t
he queue.
NUMITEMS A binary half word field that CICS sets with the number of items in the
queue.
SYSID Connection name of the remote system where this queue is defined.
Exceptions
INVREQ The queue was created for CICS internal use and cannot be written into by
a user program.
IOERR An IOERR occurred.
ISCINVREQ An undeterminable error occurred on the remote system that has the que
ue.
ITEMERR No record exists for the item number specified.
LENGERR The length of the record exceeds the length of the buffer specified.
QIDERR The specified queue does not exist.
SYSIDERR The system defined by SYSID could not be located or accessed.

Notes
The access to TS queues can be sequential or direct. For direct access specify t
he item number. Note however that CICS maintains one and only one position in th
e queue for all tasks that access the queue. If multiple tasks access the queue
sequentially, tasks may not get the next record due to intervening access by ano
ther task. If tasks want to reserve the queue for exclusive use they must use CI
CS ENQ and DEQ specifying the same resource name.
Since temporary storage queues are created and deleted dynamically, always check
for the QIDERR. If you specify ITEM check for the ITEMERR condition.
Get FREE Mainframe Interview Question & Answers - Click Here
Posted by M siva raman at Tuesday, November 02, 2010 0 comments
Labels: CICS, CICS Tutorial, Entire Mainframe Materials, Mainframe, Mainframe Tu
torials
WriteQ TS Command (TSQ)
The WRITEQ TS command
EXEC CICS
WRITEQ TS QUEUE(name)
FROM(data-area)
[ LENGTH(data-value) ]
[ ITEM(data-area) [ REWRITE ] ]
[ NUMITEMS(data-area) ]
[ SYSID(name) ]
[ MAIN | AUXILIARY ]
[ NOSUSPEND ]
END-EXEC
options
QUEUE One to eight character queue name.
FROM The data area from where the data is to be written to the queue.
LENGTH A binary half word PIC S9(4) COMP field that specifies the length of the
record to be written.
ITEM A half word PIC S9(4) COMP field which specifies the item to be rewritten w
hen REWRITE is specified. If REWRITE is not specified, CICS ignores this field o
n input and sets it with the item number of the newly written item on return.
REWRITE specifies that the item should be rewritten.
NUMITEMS A binary half word field that CICS sets with the number of items (inclu
ding this one just written) in the queue. Not valid if ITEM is coded.
SYSID Connection name of the remote system where this queue is defined.
MAIN Specifies that the item should be held in main storage.
AUXILIARY Specifies that the item should be held in auxiliary storage.
NOSUSPEND If sufficient space does not exist for the record, don t suspend the cal
ling task. Return with the NOSPACE response.
Exceptions
INVREQ The queue name is invalid, or the queue was created for CICS internal use
and cant be written into by a user program.
IOERR An IOERR occurred.

ITEMERR No record exists for the item number specified.


NOSPACE There is insufficient space to hold the TS record.
QIDERR The specified queue does not exist.(conceivably possible only when you at
tempt rewrite)
SYSIDERR The system defined by SYSID could not be located or accessed.
ISCINVREQ An indeterminate error occurred on the remote system.
Notes
TS queues are automatically created when you write a record to a queue that does
not exist.
Main or auxiliary lets you choose between the queue being on main or auxiliary s
torage.
If the data being passed between applications is small use the commarea. If more
than say 4k use a queue instead.
If you want the queue name to be unique, use the terminal ID in the EIBTRMID fie
ld as the queue name.
If you code NOSUSPEND, control is returned immediately to your program if suffic
ient space does not exist for the record. You can detect it by the NOSPACE condi
tion.
Get FREE Mainframe Interview Question & Answers - Click Here
Posted by M siva raman at Tuesday, November 02, 2010 1 comments
Labels: CICS, CICS Tutorial, Entire Mainframe Materials, Mainframe, Mainframe Tu
torials
Temporary Storage Control(TSQ)
Temporary Storage Control
Introduction
Temporary Storage provides a scratchpad area for applications to store data for
short term use. One example of usage is passing data between executions of a pse
udo conversational program.
Temporary Storage, also called TS is divided into TS queues and records, which a
re also known as items. It is incorrect to relate the term record to a file base
d record. A TS record or item size can be different for the record size of the u
nderlying data set. The underlying data set over which TS is implemented is poin
ted to by DFHTEMP dd name in the CICS startup. This is a VSAM ESDS file, set up
by the systems programmer. All CICS instance wide TS queues use this one file an
d the application programmer need not be bothered about setting this file up.
You do not need to define TS queues to CICS if you do not want them to be recove
rable, or under syncpoint control. Be aware though that if you do need to define
them, online CEDA does not support TS queue definitions. You have to code assem
bler macros and assemble and Link edit the definition into the CICS libraries. T
his is a system programmer / CICS administrators job.
System Considerations
The temporary storage table (TST) is a list of generic names (or prefixes) used
to identify sets of temporary storage queues. Generic names are formed from the
leading characters of the appropriate queue names, and can be up to seven charac
ters long.
The generic names coded on a DFHTST TYPE=RECOVERY macro identify queues for whic
h CICS provides backout of changes in the event of transaction failure or protec
tion against system failure.

The generic name coded on a DFHTST TYPE=REMOTE macro identifies queues for which
CICS routes the temporary storage request to a remote CICS region or TS server,
unless the remote system name (SYSIDNT) is the same as that of the local CICS.
If SYSIDNT is the same name as the local CICS, the queues specified by the DATAI
D option are treated by CICS as local queues.
The generic name coded on a DFHTST TYPE=LOCAL macro identifies queues as local q
ueues that reside in the CICS region in which the TST is installed.
The generic name coded on a DFHTST TYPE=SECURITY macro identifies queues for whi
ch resource security checking is required.
CICS searches the TST for the first prefix that satisfies the particular search
criteria. For example, if CICS searches for temporary storage queue ABCDEFGH, an
d the TST contains prefix A followed by prefix AB, A is selected. To avoid this,
define the less-generic entries to the TST before any more-generic entries, so
that the first to be found is the least generic of all possible matches.
Note that when CICS is looking for DATAIDs to match against a TS queue name, it
searches only the types of entry in which it is interested for that particular s
earch. CICS searches:
Local and remote entries when determining whether a queue is remote. Thus, local
and remote entries are regarded as one search category when CICS is matching a
queue name against generic names.
Recovery and remote entries when determining whether a queue is recoverable. How
ever, if the leading characters of a queue name match both TYPE=RECOVERY and TYP
E=REMOTE generic names, TYPE=REMOTE takes precedence, and the recovery option mu
st be redefined in the local region in which the queue resides. (Queues in a sha
red TS pool cannot be recoverable.)
Security entries only when determining whether a queue is subject to security.
DFHTST TYPE=INITIAL, LIST OF GENERIC NAMES OF QUEUE *
SUFFIX=01 THAT ARE RECOVERABLE, REMOTE,
* SHARED, LOCAL, OR REQUIRE
* SECURITY CHECKING.
* The following macro specifies that all LOCAL queues with
* names beginning with the letter 'R' are RECOVERABLE:
*
DFHTST TYPE=RECOVERY, *
DATAID=R
* The following macro specifies that queues with names
* beginning with C,D,E, and X are local queues:
*
DFHTST TYPE=LOCAL, *
DATAID=(C,D,E,X)
* The following macro specifies that queues with names
* beginning with AB,L,M,N are remote queues on system RSYS:
*
DFHTST TYPE=REMOTE, *
DATAID=(AB,L,M,N), *
SYSIDNT=RSYS, Queue names on remote system *
RMTNAME=LC begin with letters LC
* The following macro specifies that queues with names
* beginning with SAQ require security checking.
* Note that the full TS queue name is passed to the ESM.
*
DFHTST TYPE=SECURITY, *
DATAID=SAQ
*
DFHTST TYPE=FINAL
END

Sample Source For TS Queue Definitions.


Note that the link edited module will have the name DFHTST01. This must be point
ed to in DFHSIT, the System Initialization Table by TST=01. The creation of the
table and the DFHSIT change is the CICS administrator/ systems programmer work.
Application Programming Consideration:
As mentioned earlier the items in the queue represent data records from the appl
ication perspective. They are numbered 1 through n, although most usage will typ
ically have only one record.
Applications can fetch the item either sequentially or randomly (by specifying t
he item number).
TS control lets you choose between main storage and DFHTEMP ESDS for hosting you
r queue. Long life temporary data, typically data between pseudo conversational
executions are better stored on disk to avoid stress on main storage. Short life
data, where operator interaction does not determine the lifetime of the data, i
s better stored in main storage. However CICS does not pose any restrictions. De
pending on the response times and other CICS conditions, an application programm
er is free to choose between the methods. Note though that main storage implemen
ted queues are not recoverable as they cannot be defined in the TST.
The WRITEQ TS command
EXEC CICS
WRITEQ TS QUEUE(name)
FROM(data-area)
[ LENGTH(data-value) ]
[ ITEM(data-area) [ REWRITE ] ]
[ NUMITEMS(data-area) ]
[ SYSID(name) ]
[ MAIN | AUXILIARY ]
[ NOSUSPEND ]
END-EXEC
options
QUEUE One to eight character queue name.
FROM The data area from where the data is to be written to the queue.
LENGTH A binary half word PIC S9(4) COMP field that specifies the length of the
record to be written.
ITEM A half word PIC S9(4) COMP field which specifies the item to be rewritten w
hen REWRITE is specified. If REWRITE is not specified, CICS ignores this field o
n input and sets it with the item number of the newly written item on return.
REWRITE specifies that the item should be rewritten.
NUMITEMS A binary half word field that CICS sets with the number of items (inclu
ding this one just written) in the queue. Not valid if ITEM is coded.
SYSID Connection name of the remote system where this queue is defined.
MAIN Specifies that the item should be held in main storage.
AUXILIARY Specifies that the item should be held in auxiliary storage.

NOSUSPEND If sufficient space does not exist for the record, don t suspend the cal
ling task. Return with the NOSPACE response.
Exceptions:
INVREQ The queue name is invalid, or the queue was created for CICS internal use
and cant be written into by a user program.
IOERR An IOERR occurred.
ITEMERR No record exists for the item number specified.
NOSPACE There is insufficient space to hold the TS record.
QIDERR The specified queue does not exist.(conceivably possible only when you at
tempt rewrite)
SYSIDERR The system defined by SYSID could not be located or accessed.
ISCINVREQ An indeterminate error occurred on the remote system.
Notes:
TS queues are automatically created when you write a record to a queue that does
not exist.
Main or auxiliary lets you choose between the queue being on main or auxiliary s
torage.
If the data being passed between applications is small use the commarea. If more
than say 4k use a queue instead.
If you want the queue name to be unique, use the terminal ID in the EIBTRMID fie
ld as the queue name.
If you code NOSUSPEND, control is returned immediately to your program if suffic
ient space does not exist for the record. You can detect it by the NOSPACE condi
tion.
The READQ TS command
EXEC CICS
READQ TS QUEUE(name)
{ INTO(data-area) | SET(pointer-ref) }
[ LENGTH(data-value) ]
[ NUMITEMS(data-value) ]
[ ITEM(data-area) | NEXT ]
[ SYSID(name) ]
END-EXEC
options:
QUEUE One to eight character queue name.
INTO The data area into where the data from the queue is to be written.
SET Specifies the data area that will contain the address of the retrieved recor
d.
LENGTH A binary half word PIC S9(4) COMP field that on input specifies the lengt
h of the data area and on return from the call has the length of the record that
has been read.
ITEM A half word PIC S9(4) COMP field which specifies the item to be read from t
he queue.
NUMITEMS A binary half word field that CICS sets with the number of items in the
queue.

SYSID Connection name of the remote system where this queue is defined.
Exceptions:
INVREQ The queue was created for CICS internal use and cannot be written into by
a user program.
IOERR An IOERR occurred.
ISCINVREQ An undeterminable error occurred on the remote system that has the que
ue.
ITEMERR No record exists for the item number specified.
LENGERR The length of the record exceeds the length of the buffer specified.
QIDERR The specified queue does not exist.
SYSIDERR The system defined by SYSID could not be located or accessed.
Notes:
The access to TS queues can be sequential or direct. For direct access specify t
he item number. Note however that CICS maintains one and only one position in th
e queue for all tasks that access the queue. If multiple tasks access the queue
sequentially, tasks may not get the next record due to intervening access by ano
ther task. If tasks want to reserve the queue for exclusive use they must use CI
CS ENQ and DEQ specifying the same resource name.
Since temporary storage queues are created and deleted dynamically, always check
for the QIDERR. If you specify ITEM check for the ITEMERR condition.
The DELETQ TS command
EXEC CICS
DELETQ TS QUEUE(name)
[ SYSID(name) ]
END-EXEC
QUEUE One to eight character queue name.
SYSID Connection name of the remote system where this queue is defined.
Exceptions:
INVREQ The queue was created for CICS internal use and cannot be written into by
a user program.
ISCINVREQ An undeterminable error occurred on the remote system that has the que
ue.
QIDERR The specified queue does not exist.
SYSIDERR The system defined by SYSID could not be located or accessed.
Notes:
TS queues are automatically created when you write a record to a queue that does
not exist. Once created they have to be explicitly deleted using the DELETQ com
mand.
Queues can be created in virtual storage or via DFHTEMP in a vsam ESDS file.
You can create a unique queue name by using the value in EIBTRMID field of the E
IB.
Another way to delete a queue is to issue CEBR and issue a purge command. Since

queues can be deleted so easily, checking of QIDERR is a must.


A sample Program using TS queues:
This is a variant of the CUSTOMER maintenance program presented earlier. Since t
he program is pseudo conversational, special considerations need to be given to
the update program function. Between the time the record to be updated is read a
nd thrown on the terminal screen for user change, some other transaction may cha
nge the record in the data set. Another version of the maintenance program defen
ded itself against this possibility by maintaining a copy of the original record
in the commarea which is preserved across pseudo conversational executions. The
contents of the original record in the commarea are always checked against the
contents after a READ with UPDATE option. The REWRITE is done only if the just r
ead copy and the commarea copy match.
This version achieves the same result by storing a copy of the original record i
n a TS queue rather than in the commarea. This is a good idea if the record size
is large.
This program and artifacts are described in the section SAMPLE APPLICATION.
General TS queue considerations
Temporary storage queues remain intact until they are deleted by the originating
task, by any other task, or by an initial or cold start;
Before deletion, they can be accessed any number of times. Even after the origin
ating task is terminated, temporary data can be accessed by other tasks through
references to the symbolic name under which it is stored.
Temporary data can be stored either in main storage or in auxiliary storage. Gen
erally, main storage should be used if the data is needed for short periods of t
ime;
auxiliary storage should be used if the data is to be kept for long periods of t
ime. Data stored in auxiliary storage is retained after CICS termination and can
be recovered in a subsequent restart, but data in main storage cannot be recove
red.
The temporary storage queu
es can be defined as local, remote, or shared.
Get FREE Mainframe Interview Question & Answers - Click Here
Posted by M siva raman at Tuesday, November 02, 2010 0 comments
Labels: CICS, CICS Tutorial, Entire Mainframe Materials, Mainframe, Mainframe Tu
torials
DeleteQ TD Command

You might also like