gtpc2m7kC/C++ Language Support User's Guide

tdtac-Issue a User-Specified Data Transfer CCW

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

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