The processing of input files with standard labels is requested by means of the operand LABEL=(STD,n) of the FILE macro or the operand LABEL-TYPE=*STD(DIN-REVISION-NUMBER=n) of the ADD-FILE-LINK command.
Checking volume header labels
1. Is the first record on the tape the volume header label VOL1?
The volume header label is identified by the character string VOL1 in the fields label name and number (the first four characters on a tape with standard labels).
If the tape does not contain this string, i.e. if the first record is not a VOL1 label, DMS issues message DMS0DA2
and the operator must react to this message.
2. Is the file already cataloged or is it a foreign or imported file? Has the user already requested a tape for the foreign or imported file?
If the file is already cataloged, its catalog entry contains the list of tapes it occupies. For foreign files (i.e. files to be imported which have not yet been cataloged), you must specify the VSNs of the required tapes in the VOLUME operand of the FILE macro or in the VOLUME operand of the IMPORT-FILE or CREATE-FILE command. If you have not done this, DMS issues message DMS0DFB
on the console at teh time OPEN processing takes place so that the operator can check the mounted tape.
3. Does the VSN in the VOL1 label match the VSN specified in the FILE macro or in the IMPORT-FILE/CREATE-FILE command?
DMS compares the contents of the third field in the VOL1 label (the VSN of the tape) with the VSN specified by the user. If they do not match, DMS issues message DMS0DA1
on the console. Now the operator can check the label, mount a new tape, abort the program (OPENER routine), or ignore the message (if the job has the appropriate TPIGNORE authorization).
4. Is access permitted only for the tape owner? If so: is the user ID the same as the tape owner identifier?
DMS evaluates the contents of the VOL1 fields “access indicator” and “owner identifier”. If the user is not authorized to access the tape, DMS sends him/her message DMS0DD7
. The user can now terminate his/her program or have label checking retried (with a different tape in the case of foreign files).
5. Does a non-BS20000 tape contain further VOL labels?
DMS ignores the volume header labels VOL2 to VOL9, i.e. it does not evaluate them and skips to the next step of OPEN processing.
6. Are the standard volume labels followed by user volume labels (UVLs)?
UVL labels must be processed by special routines in the user program, to which the program branches via the OPENV exit of the EXLST macro. If the tape contains UVL labels (UVL1 through UVL9), DMS activates the OPENV routine for each such label; the address of the label is passed in register 0. In each case, label checking is terminated by means of the LBRET macro. If the program does not have an OPENV routine for processing UVLs, DMS ignores these labels.
Positioning
Next, DMS positions the tape to the start of the file to be read. It is determining the position of the file on the tape from the FILE/FCB macro (operand FSEQ), from the ADD-FILE-LINK command (operand FILE-SEQUENCE), or from the catalog entry (field FSEQ). If the file is a foreign file whose tape position is unknown, the user can specify FSEQ=UNK (= unknown) in the FILE/FCB macro or FILE-SEQUENCE=*UNKNOWN in the ADD-FILE-LINK command. In this case, DMS positions the tape to behind the volume header labels and then searches the whole tape. Once the tape has been positioned correctly, DMS checks the file header labels HDR1 through HDR3 and UHL1 through UHL255.
Checking file header labels
1. Is the first record of the file, or the first record after the volume header labels, the HDR1 label?
The HDR1 label has the character string HDR1 in the first four bytes. If DMS does not find this string, it sends message DMS0DD8
to the user. After correction, the user can have the label check retried. If he wanted to read a foreign file, he has to search for it on another tape.
If DMS finds a HDR1 label, it then reads the HDR2 label. It does not read the HDR3 label unless it can see from the system code of the HDR1 label that the tape file was created in BS2000. Only in this case are the steps described under 2 and 3 carried out.
2. Do the file names in the HDR1 and HDR3 labels match the file name entered by the user?
DMS compares the file names in the HDR1 and HDR3 labels with the file name specified in the FILE macro or in the IMPORT-FILE/CREATE-FILE command. If they do not match, DMS sends message DMS0DA5
to the user, who can react with “Terminate program”, “Retry label checking”, “Print label”, or “Ignore” (depending on his/her TPIGNORE authorization).
3. Is file access permitted only for the file owner? If so: does the owner identifier in the HDR3 label match the user ID of the job?
The HDR1 field “access indicator” shows whether a file is shareable. If the file is not shareable, DMS compares the owner identifier in the HDR3 label with the user ID of the job. If these do not match, DMS sends message DMS0DD7
to the user, who can react as described for VOL1 label checking, namely by terminating the program or repeating the label check (with another tape in the case of foreign files).
4. Does the file section number in the HDR1 label match the number specified in the FILE macro or ADD-FILE-LINK command?
The file section number, which is kept in the HDR1 label, shows the position of a file section within a volume set. With the VSEQ operand of the FILE macro or the VOL-SEQUENCE-NUMBER of the ADD-FILE-LINK command, the user has specified which section of a multivolume file he/she wants to process. If these two entries do not match, DMS sends message DMS0DD6
. The user can – if authorized – ignore it or react to it as he/she sees fit.
5. Are there passwords to be transferred to the catalog entry?
For foreign files cataloged by means of a FILE macro or IMPORT-FILE command, any passwords in the HDR3 label are transferred to the new catalog entry.
6. Does the file have a retention period or is it write-protected?
If the file is to be opened with OPEN INOUT or OPEN EXTEND (see OPEN modes in the “DMS Macros” manual [1 (Related publications)]), DMS checks the HDR3 field “access type”, which corresponds to the ACCESS specification in the catalog entry. It also checks the field “expiration date”
in the HDR1 label, which indicates whether a retention period still exists for the file or whether it can be overwritten. A retention period may have been defined via the operand RETPD of the FILE/FCB macro or the RETENTION-PERIOD operand of the ADD-FILE-LINK command when the file was created.
If either the “access type” or the “retention period” indicates that the file is write-protected, DMS sends message DMS0DA3
to the user. The User can – if she/he is authorized – ignore this message and continue processing, or have label checking retried (with a different tape in the case of foreign files), or have his program terminated correctly via an exit routine (OPENER).
7. Are the HDR labels followed by user header labels (UHLs)?
User header labels (UHL0 through UHL255) have to be evaluated by an exit routine in the user's program, to which the program branches via the LABGN exit of the EXLST macro. DMS activates this routine for each such label; the label address is passed in register 0. In each case, label checking is terminated by means of the LBRET macro. If the program has no facilities for user header label processing, DMS ignores these labels.