gtpc2m7k | C/C++ Language Support User's Guide |
This function is used to start a single data transfer channel control word
(CCW) for the specified tape name.
Format
#include <tpftape.h>
long tdtac (const char *name,
enum t_lvl level);
- name
- A pointer to type char, which must be a 3-character string
identifying the tape whose status will be obtained.
- level
- One of 16 possible values representing a valid data level from enumeration
type t_lvl, expressed as Dx, where x represents
the hexadecimal number of the level (0-F). This parameter
identifies the file address reference word (FARW), which contains a format-1
CCW. On return, the data level will be unchanged.
Normal Return
The normal return is a positive value.
Error Return
An error return is indicated by a negative return code.
The following error codes are common for this function:
- -1
- End of tape.
- -2
- Hardware error.
- -3
- Long length record.
- -4
- Short length record.
The details of the error can also be obtained by examining the value in the
CE1SUG field in the entry control block (ECB).
Programming Considerations
- This function calls the equivalent of the waitc
function.
- Command chaining and data chaining are not allowed.
- The FARW for the data level specified by the level parameter
must contain the format-1 data transfer CCW.
- The general tape specified by the name parameter must be assigned to this
ECB when this function is called.
- During normal processing of this function, the CCW contained in the FARW
is not modified. If an incorrect record length is found, the length
field will be in the last 2 bytes of the FARW on the data level specified by
the macro.
- This function runs independently of normal tape handling and volume
switching facilities. When an unusual condition such as end-of-file,
end-of-tape, or hardware error occurs, a return is made to the operational
program by way of the waitc return mechanism. Note that
write operations are allowed to be completed when an end-of-tape condition is
detected and the operation is appropriately flagged to indicate this
condition. For this function only, an end-of-tape condition on a write
operation is flagged by the same indicator bit as an end-of-file condition on
a read operation.
- Do not use this function to write heap storage areas to a blocked
tape.
- If an attempt is made to write a record longer than the maximum length, a
system error is issued.
- For write operations to a blocked tape, the maximum byte count of the
record being written is 32 752.
- For write operations to an unblocked tape, the maximum byte count of the
record being written is 65 535.
- The minimum record size that can be written or read is 16 bytes.
- For write and sense commands, the suppress length indication flag is
automatically set by the control program.
- This function cannot be used to issue a Read Backwards command to a
blocked tape. If this is attempted with a blocked tape, a system error
is issued.
- No check is made by the control program to see if the command is supported
by the device. For example, a command code to read configuration data
can be sent to a 3480 tape device even though it is not defined for that
device type.
Examples
The following example retrieves the current tape position using a Read
Block ID CCW, which was issued through the tdtac function.
#include <tpftape.h>
#include <c$tpxd.h>
long example()
{
CW0CCW temp_ccw;
long tape_return_code;
TPFxd_location *positioningString;
temp_ccw.cw0ccw1.cw0cmd1 = tape_ccw_rbid;
temp_ccw.cw0ccw1.cw0bct1 = sizeof(positioningString->offset);
temp_ccw.cw0ccw1.cw0adr1 = &positioningString->offset;
temp_ccw.cw0ccw1.cw0flg1 = CW0SLI;
memcpy(&(ecbptr()->ce1faf),&temp_ccw,sizeof(temp_ccw));
tdtac (token->ext_name,DF);
}
Related Information