Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Reading and Modifying a Job File Control Block (RDJFCB Macro) z/OS DFSMSdfp Advanced Services SC23-6861-01 |
|
To accomplish the functions that are performed as a result of an OPEN macro instruction, the open routine requires access to information that you have supplied in a data definition (DD) statement. This information is stored by the system in a job file control block (JFCB). Some information is placed into the JFCB when the data set is allocated, while other information is placed there only when the data set is opened. Which fields are updated and when they are updated will vary depending upon factors such as what is specified in the JCL DD statement, what the application does, whether the data set is SMS managed or not, and so on. Fields that have not been updated yet will contain binary zeroes. In certain applications, you might find it necessary to modify the contents of a JFCB (previously specified in the allocation parameters) before issuing an OPEN macro instruction against a data set. For example, lets suppose that you are adding records to the end of a sequential data set. You might want to add a secondary allocation quantity to allow the existing data set to be extended when the space currently allocated is exhausted. To assist you, the system provides the RDJFCB macro instruction. This macro instruction causes a JFCB to be moved to an area specified in an exit list. Use of the RDJFCB macro instruction with an exit list is shown under Example. When you subsequently issue the OPEN macro instruction, you can specify the TYPE=J operand to open the data set using the JFCB in the area you specified. You can use RDJFCB and a DCB to learn the data set name, AMP parameters and volume serials of a VSAM data set. You can use any valid combination of MACRF and DSORG in the DCB. The simplest would be DSORG=PS,MACRF=R. You cannot use the JFCB with OPEN TYPE=J to open a VSAM data set. If you specify the XTIOT, UCB NOCAPTURE or DSAB-above-the-line options of dynamic allocation, then the system creates an XTIOT. With these options, if the access method is not EXCP and the data set is not VSAM, then RDJFCB requires that you code the LOC=ANY option on the DCBE macro, and the NON_VSAM_XTIOT=YES option in the DEVSUPxx member of SYS1.PARMLIB is in effect. The RDJFCB macro also allows you to retrieve allocation information for the data sets in a concatenation. You can either select data sets or, by default, retrieve the information for all data sets in the concatenation. You can retrieve the following items:
Type 07 JFCB Exit List Entry describes how you can use RDJFCB to retrieve this information. Tip: If you set the bit JFCNWRIT in
the JFCBTSDM field to
1 before you issue the OPEN macro instruction, the JFCB is not written
back at the conclusion of open processing. OPEN TYPE=J normally moves
your program's modified copy of the JFCB, to replace the system copy.
To ensure that this move is done, your program must set bit zero of
the JFCBMASK+4 field to 1. IBM® recommends
not setting on JFCNWRIT. If the user JFCB (which the system used to
open the data set) is not written back, errors can occur during termination
processing for EOV, CLOSE, or the job/step because OPEN might have
updated information in the user JFCB which will not be reflected in
the system copy of the JFCB. For example, when a nonspecific tape
data set is opened, OPEN will update the user supplied JFCB with the
volume serial number of the tape selected. However, the system copy
of the JFCB will not reflect this volume serial number. This could
cause errors during termination processing for EOV, CLOSE, or the
job/step (for example, the data set might not be cataloged even though
the job requested it).
Your program can also use the SWAREQ macro to access JFCBs and JFCBXs. It requires your program to access the DSAB or DSABs and the TIOT or XTIOTs. You can use the GETDSAB macro for this and you will need several mapping macros. SWAREQ and GETDSAB are documented in z/OS MVS Programming: Authorized Assembler Services Guide. The RDJFCB macro is designed to be simpler to use and does not require examining system control blocks. Some of the modifications that can be made to the JFCB include:
The secondary allocation quantity will be moved from the DSCB into the JFCB unless prevented by the setting of JFCNWRIT or JFCNDSCB. |
Copyright IBM Corporation 1990, 2014
|