ENDBR - IBM Mainframe

ENDBR command is used to terminate a current browse function. Stops a current browse command on a file or CICS-maintained data table that reside on either a local or remote system. A browse command should be terminated prior to performing any update commands (i.e., READ UPDATE, DELETE with RIDFLD, or WRITE) or before executing a syncpoint command, failure in doing so may result in a possible deadlock condition on the CICS resources being requested. The syntax of the ENDBR command is given below:

An example of the ENDBR command is given below:

The various options of the ENDBR command are explained below:

  • FILE (filename) - Alphanumeric field (1-8 characters) specifying the file for browsing. If the SYSID option is used then the file name is assumed to be on a remote system regardless of whether the FCT contains an entry for the table, otherwise the FCT is used to find the location of the data set. (Local or remote)
  • REQID (data_value) - Halfword binary value containing a unique request identifier for use in a browse. Used when operating multiple browse operations against a file. If this option is omitted, then the default value is zero.
  • SYSID (remote_system_name) - Alphanumeric field (1-4 characters) containing the remote system name in which the request is to be directed.

The different handle conditions are:

  • FILENOTFOUND - FILE option name referenced is not found in the FCT. The default action is the abnormal termination of the task.
  • ILLOCIC (VSAM only) - A VSAM error that does not fall within any other CICS response categories. The default action is the abnormal termination of the task.
  • INVREQ - ENDBR command has been issued without a STARTBR command having been previously issued. The default action is the abnormal termination of the task.
  • ISCINVREQ - Indicates failure in a remote system, which does not correspond to a known condition. The default action is the abnormal termination of the task.
  • NOTAUTH - Resource security check failure on a FILE (filename). The default action is the abnormal termination of the task.
  • SYSIDERR - Occurs when either the remote name specified in the SYSID option is closed or has not been defined to the host CICS system (this is accomplished by defining a CONNECTION in CICS). The default action is the abnormal termination of the task.

Multiple Browse Operations

The multiple browse operations are used to perform several concurrent browse operations against the same file. One browse operation is to be identified by the REQID parameter in the BROWSE commands. Here what is done is that for each group of browse, first a REQID is established. Then whatever browse operation whether it is READNEXT or READPREV, issued with that REQID would be pertaining to that group. So using this method you can browse a file from the beginning using READNEXT and from the end using READPREV at the same time, by specifying different REQID for the two browse operations.

But one disadvantage with multiple browses is that, it is costly in terms of resource usage. This is because; one browse operation occupies one string of VSAM. If all VSAM strings are exhausted for one VSAM file, the other transaction will have to wait until one of the strings become free. So the multiple browse operations should be used only when they are absolutely required.

Update during Browse

Even though updating a record during a browse is not usually done because they are two mutually exclusive operations, if for some reason, this has to be done, the following procedure must be followed. Issue an ENDBR command for temporarily suspending the browse and then issue a READ with UPDATE. Then do the necessary updates and issue a REWRITE command for updating the record and then resume the browse operation by issuing a STARTBR command. Jf this process is not followed, that is if you try to update without first stopping the browse, deadlocks can occur.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics