gtpc2m2mC/C++ Language Support User's Guide

file_record-File a Record: Higher Level

This service files a record to either VFA or DASD.

Format

#include   <tpfio.h>
void       file_record(enum t_lvl level, const unsigned int *address,
                       const char *id, unsigned char rcc, enum t_act type);

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 working storage block on this core block reference word (CBRW) level is the record to be filed.

address
A pointer to the file address indicating where the record will be filed.

id
A pointer to the 2-character record ID.

rcc
An unsigned character that represents the value to be assigned to the record code check field of the record being filed.

type
The disposition of the record's hold status, or the associated working block. This argument must belong to the enumeration type t_act, defined in tpfio.h.

NOHOLD
The record is not in hold status and the associated working storage block can be returned to the system.

UNHOLD
The record is in hold status and the associated working storage block can be returned to the system.

NOREL
The record is not in hold status and the associated working storage block should not be returned to the system.

Normal Return

Void. The associated working storage buffer block has been made unavailable to the operational program. For NOREL calls, the buffer block will be available to the operational program following a subsequent waitc call.

Error Return

Not applicable.

Programming Considerations

Examples

The following example files a record from D6 with id set to IM, the rcc set to zero, and the file address taken from the forward chain field of another record.

#include <tpfio.h>
struct im0im
   {
      char              im0bid[2];          /* record ID         */
      unsigned char     im0rcc;             /* record code check */
      unsigned char     im0ctl;             /* control byte      */
      char              im0pgm[4];          /* program stamp     */
      unsigned long int im0fch;             /* forward chain     */
      unsigned long int im0bch;             /* backward chain    */
      short int         im0cct;             /* byte count        */
      .
      (data fields)
      .
   } *inm;
     .
     .
     .
file_record(D6,(const unsigned int *)&(inm->im0fch),"IM",'\0',NOHOLD);
 

Related Information