gtpc2m8r | C/C++ Language Support User's Guide |
This function reads a record from an assigned general tape.
Format
#include <tpftape.h>
void tprdc(const char *name, enum t_lvl level, enum t_blktype size);
- name
- This argument is a pointer to type char, which must be a
3-character string identifying the tape to be read from. 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). The record
being read from tape is attached to this level.
- size
- Storage block list type which is placed on the indicated CBRW. This
argument must belong to the enumeration type t_blktype, defined in
tpfapi.h. The record length incoming from tape must
match the size of the indicated pool storage type. Use Lx notation,
where x is a valid pool type:
- L0
- 127 bytes
- L1
- 381 bytes
- L2
- 1055 bytes
- L4
- 4095 bytes.
Normal Return
Void.
Error Return
Not applicable.
Programming Considerations
- The tape specified as argument name must have been previously
opened.
- The CBRW level specified by argument level must be unoccupied
at function call time.
- Use this function to cause a record to be read from a general tape at the
current position. The waitc function must be called to
ensure that the operation has completed. The application is responsible
for establishing a pointer to the record on completion.
- Prior to calling tprdc, the tape must have been assigned to the
issuing ECB via topnc or tasnc.
- If the tape is mounted in blocked mode, the application should not assume
that the execution of this function causes either any physical I/O to be
initiated or the application timeout value to be reset.
Examples
The following example reads a 1055-byte record from the VPH tape to level
D2. A message is issued if an I/O error occurs.
#include <tpftape.h>
·
·
·
tprdc("VPH",D2,L2);
if (waitc())
{
serrc_op(SERRC_EXIT,0x1234,"ERROR READING VPH TAPE",NULL) ;
}
Related Information