UPAM offers the following functions for tape files:
Creation of tape files not extending over more than one tape; the user is responsible for programming access to logical records in these files.
Reading of SAM files with standard blocks; the file attributes are stored in the FCB by OPEN processing (see the chapter “OPEN processing” in the “Introductory Guide to DMS” [1]), e.g. BLKSIZE, RECSIZE, RECFORM. This enables the user to program access to logical records.
Chained I/O is not possible for tape files.
Informing the user job upon termination of a UPAM I/O operation and start of a contingency process (eventing mechanism).
When using UPAM, the following basic points must be noted:
UPAM is a block-oriented access method, i.e. the system is unaware of any logical structure within the blocks. The user must program his own record handling.
The following points apply to the use of UPAM with tape files:
The file must reside on a single tape.
Every read/write operation processes exactly one physical block.
In the case of a file with the format BLKCTRL=PAMKEY (explicit or implicit), this must be a 2064-byte standard block. The first 16 bytes contain the PAM key and the remaining 2048 bytes contain the user data. Only STD or 2048 may be specified for the LEN operand of the PAM macro.
In the case of a file with the format BLKCTRL=DATA or BLKCTRL=NO, BLKSIZE can be specified in bytes, in which case the value must be a multiple of 2048. The LEN value must not be greater than the BLKSIZE value. Blocks of the length specified by LEN and containing either only user data (with BLKCTRL=NO) or a 12-byte block control field plus the LEN value minus 12 bytes of user data (with BLKCTRL=DATA) are written to the tape. These blocks can be read by means of the UPAM function RD, in which case the value for LENRD in the read call must lie within the range:
LENWR <= LENRD <= BLKSIZE. (LENWR = value for LEN when writing to the file.)In this context, the following special feature applies to files with FCBTYPE=ISAM: regardless of the value specified for BLKSIZE, UPAM always works with a block size of 2048 bytes. This is because, for ISAM, each 2K block has a block control field and thus constitutes a separate entity. In this case, the LEN value must not be more than 2048.
The following errors may arise in the context of a UPAM access to a tape file with BLKCTRL=PAMKEY and nonstandard blocks (not equal 2064 bytes):
hardware error (error code = 927)
the data may be stored in the buffer incorrectly
the PAM key may be corrupted.
Tape files must not be accessed by several jobs at once, or by one job several times (this is due directly to the properties of magnetic tape). This means that:
a tape file must not be opened with SHARUPD=YES/WEAK
a tape file which is already open cannot be opened again, even when both OPEN operations are in INPUT mode
a tape file must not be opened with an FCB operand whose PAMREQS value is greater than one.
It is possible to read a tape file with UPAM using random access. However, the time outlay involved can be considerable.
It is possible to write PAM blocks as of a specific point in an existing tape file. The last newly written block automatically becomes the last block in the file, even if the existing file contained more blocks. The file can then only be read up to this block. If a block nearer the start of the file is then read and the file is then closed, the most recently read block becomes the last block in the tape file.
Programming notes
Magnetic tape cartridges are treated just like normal magnetic tapes.
Whenever UPAM causes program termination, it places the address which was responsible for the abortion in register 0, while the address of the element in the UPAM operand list chain at which the error was detected is placed in register 1, and the UPAM error code is placed in register 15. This facilitates location of this information in memory dumps.
If register 1 contains an invalid address after the first PAM macro is issued, register 0 in the memory dump will also contain this address; register 1 will then contain the value 0, i.e. the error occurred before the first element of the operand list chain could be located.
UPAM uses the following EXLST exits:
ERRADDR USERERR | Hardware error or abnormal I/O termination. Invalid operation, such as an attempt to read a PAM page which does not |
Fields ID1LWB (PARMOD=24) and ID1LWBPT (PARMOD=31) in the FCB are used to store the address of the last block on which a WT operation was carried out successfully by UPAM. The leftmost byte of field ID1LWB is used as an indicator byte.
If the last UPAM operation on the file was a successful WT, then the indicator byte in ID1LWB is set to X'00' and the three least significant bytes of ID1LWB/ID1LWBPT contain the address of the block affected by the WT operation. This occurs regardless of whether or not the operation which initiated the WT was successfully completed.
If the last UPAM operation on that file did not initiate a WT, the indicator byte in ID1LWB is set to X'FF'. The contents of the rightmost three bytes in ID1LWB/ID1LWBPT are of no significance.