Professional Documents
Culture Documents
New MF 1
New MF 1
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
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
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.
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.
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
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