Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Sequence of OPEN processing

OPEN processing varies slightly, depending on whether or not the user the is working with the XS interface (31-bit addressing). The following section describes the sequence for XS OPEN processing.

The special features of the 24-bit interface are described in section "XS and non-XSinterfaces".

DMS executes the following steps:

  • Add missing information to the FCB from the TFT and the catalog entry.

  • Request private volumes (if needed).

  • Link the FCB to the routines of the access methods. Store in the FCB the addresses of the logical routines (TU logicals) which handle the blocking and unblocking of records.

  • Construct the privileged internal file control block (TPR FCB): the user cannot access this control block; it is used internally by DMS.

  • Allocate buffer areas.

  • Update the catalog entry.
    In particular with node files the file attributes CHANGE-DATE, FILESIZE, Highest-Used-Page (LPP) and LBP are obsolete when a foreign system has modified the files. These values are updated automatically during OPEN processing. Please note that in the case of successive OPEN calls (without any CLOSE), the CE will only be updated during the first OPEN. The following OPEN receive the current values of the LPP and LBP in the FCB.
    The catalog entry can, however, also be updated manually with IMPORT-NODE-FILE REPLACE = *NODE-FILE-UPDATE. In this case, the updated values for FILESIZE and LPP are only estimated for SAM node files.

Note

The catalog entry for a file is not complete until the file has been opened as an output file and closed again at least once. A distinction is therefore made between cataloged files and existing files.
If DMS macros refer to “cataloged files”, for instance, then catalog entries must exist for these files.
If the macros refer to existing files, then these files must have been opened at least once as output files. Such files may still be empty, however, i.e. may contain no records accessible to the user.
The latest page pointer (last-page pointer) and the “last-byte pointer” are not transferred to the catalog entry until the file is closed.
The last-page pointer is only relevant for PAM files and SAM node files opened in UPAM-RAW mode.

The main actions performed in the file opening sequence for disk and tape files are as follows:

  • Search for a TFT entry with the file link name contained in the FCB. The file link name is either taken from an FCB macro or written directly into the control block. Every FILE/ADD-FILE-LINK or CHNGE/CHANGE-FILE-LINK call creates or updates an entry in the TFT. Each such entry includes all the parameters required to update the file control block and establishes a link between the application program and the file via a link name (LINK operand). There is no search for a TFT entry if the LINK operand of the FCB macro contains a file link name consisting of 8 blanks (8X'40'; 8C'_').

    The appropriate TFT entry is used to update corresponding fields in the file control block. If no entry with the specified file link name exists or if the link name in the FCB consists of 8 blanks (8X'40'; 8C'_'), a TFT entry is created during OPEN processing. This TFT entry is automatically released by the system (implicit RELEASE) at the CLOSE. Only the TFT entries generated with FILE (LINK operand) are retained until explicitly released (REMOVE-FILE-LINK command or RELTFT macro).

    Fields specified as null operands in the FILE macro are assigned the entry “BY-CATALOG” in the TFT. The corresponding fields in the FCB are completed later with information from the catalog entry.

  • Complete the file name. This means that if the file name was not specified in its complete form by the user, the catalog ID and the user ID are added to it, and the completed file name is stored in the form catid:$userid.filename in the associated TFT entry and the FCB. If no user ID is specified, the user ID of the SET-LOGON-PARAMETERS command is used. If no catalog ID is specified, the default catalog ID that was defined for the user ID is used.

  • Read the catalog entry for the requested file. If the file cannot be found under the explicitly specified catalog ID and user ID, and is not located under the default ID of a default catalog, OPEN processing is aborted with an error message. If the OPTION=GLODEF operand was specified in the FCB call. no error occurs; a secondary read will be performed instead.

    An example of “secondary read”, which is enabled by means of the FCB operand OPTION=GLODEF, can be found on "Access via the system default user ID".

    As far as possible, undefined fields of the FCB are filled with information from the associated catalog entry. In the case of files with the status FOREIGN (tape files being exchanged), the parameters are taken from the tape labels.

  • Compare the volume list of the catalog entry with the volume list recorded in the TFT. If no such entries are recorded in the TFT, they are created from the specifications in the catalog, and the required volumes are then requested via Device Management.

  • Assign tape devices.

    If a TSET is defined for the file, DMS compares the volume lists of the TFT entry and the related TST (tape set table) entry. It thereby is assuming that the file begins on the tape specified as the current tape in the TST. If the TFT volume list contains the current VSN, any VSNs which precede this in the TFT volume list are not transferred to the catalog entry. If the TFT volume list does not contain the current VSN, the current VSN and all VSNs which follow this in the TST list replace the TFT volume list and are transferred to the catalog entry.

    If no TSET is defined for the file, but the TFT entry contains a temporary volume list (TVSN), DMS assigns the required tape on the basis of this TVSN. The volume list in the catalog entry is ignored. The OPEN is rejected if the file is an output file. If no TSET is defined, but VSEQ is specified in the FILE macro, the file must not be opened with OPEN INPUT/EXTEND. The first or last tape in the TFT volume list is assigned.

    If neither TSET nor TVSN or VSEQ is defined, the volume list of the catalog entry is updated to match that of the TFT entry and the first or last tape in the list is assigned.

  • Create the internal privileged file control block (TPR FCB) and initialize it with values from fields of the FCB and the catalog entry.

    The original FCB with its field values is stored in a save area at the end of the TPR FCB before the OPEN sequence.

  • Branch to the OPENX exit of the EXLST macro (if provided in the program). At this point the program can check whether the validity of the values set thus far. If the program changes the fields of the file control block, processing continues with these values. If a new file is being created, the values are also transferred to the labels and the catalog entry. The file name, link name and shared-update mode can no longer be changed. Processing is resumed by means of the EXRTN macro.

  • Branch to the OPENZ exit of the EXLST macro (if provided in the program). At this point the program has a further opportunity to update the file control block, but this time the changes are not transferred to the catalog entry. It is thus possible, for example, to process a file using a different access method from the one entered in the catalog. The file name, link name, OPEN mode, and shared-update mode can no longer be changed. Processing is resumed by means of the EXRTN macro.

  • Check I/O performance data and existing cache configuration to determine whether a cache is to be used when processing the file or not. This is subject to the following considerations:

    If the file has already been opened by another job, the attributes currently set also apply to this OPEN.

    If this is the first time the file has been opened, the static performance attributes (PERFORMANCE, USAGE and DISK-WRITE) are checked against the cache attributes, and the values set accordingly are stored in the catalog entry. (Example: if DISK-WRITE=*IMMEDIATE and USAGE=*WRITE/*READ-WRITE, write caching is not permitted unless a secure (nonvolatile) cache is used).
    Dynamic replacement of the static PERFORMANCE and USAGE values defined in the catalog entry by lower values is possible using TFT or FCB entries, permitting caching to be deactivated for the current file processing; the attributes stored in the catalog entry are not modified by this operation.

  • Check user specifications against the catalog entry of the file. (The file must be an input file, i.e. the OPEN mode must not be OUTPUT or OUTIN.)

  • Transfer FCB values to the catalog entry. If the file to which the FCB refers is an output file (OPEN OUTPUT/OUTIN), the FCB values are transferred to the catalog entry.

  • Check access specifications concerning expiration dates, access rights, and passwords for files. This check is performed for previously created files.

  • When creating a new file (OPEN mode OUTPUT or OUTIN) on an SM pubset, check whether the attributes of the current location are compatible with the requested file attributes (e.g. file format BLKCTRL= PAMKEY). If they are incompatible, the file must be reallocated with a compatible location (without data transfer).

  • Create check labels for tape processing (see "Label processing when opening tape files"). When a tape file is newly created, the file header labels HDR1, HDR2, and HDR3 are initialized with values and written before the first block of the file. When the file is accessed for reading, the contents of these labels are used to identify the file and to check the access authorization. Label information must be structured in compliance with the DIN 66029 standard to ensure normal processing. If the tape file does not contain standard labels in accordance with the above DIN standard, the checking of the tape file will need to be handled by user routines.

  • Assign I/O areas or validate buffer addresses if they have been specified by the user.

  • Load the connection routines (TU logicals) if the access method SAM or ISAM is being used.

  • Set up a connection between file control block and access methods: the addresses of the logical routines are placed in the FCB.

  • Update and rewrite the catalog entry if required.

Notes

The file will be destroyed if an error occurs during OPEN processing after reallocation of the file.

Furthermore, reallocation may result in modifications of the extent list during OPEN processing; this means that the information supplied by the FSTAT macro or the SHOW-FILE-ATTRIBUTES command will be different after the OPEN.

The OPEN will be rejected with return code DMS0D80 if no suitable location can be found within the SM pubset.