gtpc2m2y | C/C++ Language Support User's Guide |
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 an external
device.
Format
#include <tpfio.h>
void *finwc(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
Pointer to the working storage block containing the retrieved record
image.
Error Return
NULL.
Programming Considerations
- The finwc function cannot be issued on a record that is part of
the suspended commit scope of an ECB. The following sequence will cause
a system error:
- tx_begin()
- filec() record X
- tx_suspend_tpf()
- finwc() record X.
- The specified CBRW is initialized to indicate that a block of storage is
attached to the specified data level. Specifying an invalid data level
results in a system error with exit.
- TPF checks to determine if the ECB is holding a block of storage at the
specified level, and if the file address contained at the specified level is
valid. If either condition is violated, control is transferred to the
system error routine. In addition, the record ID on the specified
level, if nonzero, is compared with the record ID in the record retrieved from
file. The record code check on the specified level, if nonzero, is also
compared the record code check in the record. If either check fails, an
error code is posted in the ECB level indicators.
- Calling this function resets the 500-millisecond program time-out.
- TPF transaction services processing affects finwc processing in
the following ways:
- If a system error occurs because of one of the previous considerations,
processing ends as if a rollback was issued.
- The TPF system will first search for the record in the commit
scope. If the record is not found, normal DASD retrieval will take
place from virtual file access (VFA) or the DASD surface.
Examples
The following example retrieves a data record from file on level D2.
The file address has already been calculated and resides in the level D2
FARW. Control is returned to the operational program when the I/O is
complete and the record has been attached to the specified level.
#include <tpfio.h>
struct im0im *inm;
·
·
·
inm = finwc(D2);
Related Information