gtpc2m2wC/C++ Language Support User's Guide

finhc-Find and Hold a File Record

This function reads a record and attaches the block of working storage containing it to the specified data level of the entry control block (ECB). The ECB must not be holding a storage block on the specified level.

This service finds a record that resides either in VFA or on DASD.

The TPF system queues this request if the record is being held by another entry. All succeeding requests to hold this record are queued until the record is unheld.

Format

#include   <tpfio.h>
void       finhc(enum t_lvl level);

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 data record being retrieved is attached to this level.

Normal Return

Void.

Error Return

Not applicable.

Programming Considerations

Examples

The following example retrieves a data record from file on level D2 with hold. The file address has already been calculated and resides in the level D2 FARW.

#include <tpfio.h>

  ·
  ·
  ·
finhc(D2); if (waitc()) { serrc_op(SERRC_EXIT,0x12345,"I/O ERROR OCCURRED",NULL); /* In TARGET(TPF) this used to be done with: errno = 0x1234; perror("I/O ERROR OCCURRED"); abort(); */ }

Related Information