gtpc2m7r | C/C++ Language Support User's Guide |
This function is used to start a single control operation channel control
word (CCW) for the specified tape name.
Format
#include <tpftape.h>
long tpcnc (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 zero return code. The details of
the error can 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, however, the
byte count in the CCW will be adjusted to reflect the actual number of bytes
transferred.
- 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 using the waitc return mechanism.
- No check is made by the control program to see if the command is supported
by the device.
Examples
The following example writes a tapemark using the tpcnc
function.
#include <tpftape.h>
long example()
{
CW0CCW temp_ccw;
long ioreturncode;
temp_ccw.cw0ccw1.cw0cmd1 = tape_ccw_wtm;
temp_ccw.cw0ccw1.cw0bct1 = 1;
temp_ccw.cw0ccw1.cw0adr1 = 0;
temp_ccw.cw0ccw1.cw0flg1 = 0;
memcpy(&(ecbptr()->ce1faf),&temp_ccw,sizeof(temp_ccw));
ioreturncode = tpcnc (token->ext_name,DF);
}
Related Information