gtpc2m7f | C/C++ Language Support User's Guide |
This function backspaces a general tape a specified number of records and
waits until the tape is correctly positioned before returning control to the
user. If this function is issued to a tape that is mounted in blocked
mode, a system error will occur.
Format
#include <tpftape.h>
int tbspc(const char *name, enum t_lvl level, int fallback);
- name
- This argument is a pointer to type char, which must be a
3-character string identifying the tape to be backspaced. This function
can only be called for a general tape.
- level
- One of 16 possible values representing a valid data level from the
enumeration type t_lvl, expressed as Dx, where x
represents the hexadecimal number of the level (0-F). This
parameter specifies the FARW from which the number of records to backspace is
to be obtained, right justified in CE1FAx.
- fallback
- This argument applies when operating a on a multivolume tape file.
If FALLBACK is specified, the previous volume is mounted if the
load point was reached on the current volume and more records exist to
backspace. If NO_FALLBACK is specified, backspacing stops at
the load point with no fallback to the previous volume.
Normal Return
Integer value of zero if the operation is successful.
Error Return
The value of CE1SDx is returned if an I/O error occurs.
Programming Considerations
- Specifying an invalid data level results in a system error with
exit.
- The tape must already have been assigned to the issuing ECB before this
function is called.
- This function calls the equivalent of waitc.
- The number of physical blocks to be backspaced must be from 1 to
65 535. Attempts to backspace more than 65 535
records will backspace the number of records equal to the value entered mod 64
K.
Examples
The following example backspaces the VPH tape by the specified number of
records.
#include <tpftape.h>
int recs = 3;
·
·
·
(*((short *)&ecbptr()->ce1fh9)) = recs;
if (tbspc("VPH",D9,FALLBACK))
{
serrc_op(SERRC_EXIT,0x1234,"ERROR BACKSPACING VPH TAPE",NULL) ;
}
Related Information