gtpc2m2t | 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 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 DASD.
Format
#include <tpfio.h>
void findc_ext(enum t_lvl level, unsigned int ext);
- 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.
- ext
- Sum of the following bit flags that are defined in
tpfio.h.
- FIND_GDS
- Use FIND_GDS to specify that the record to be read resides in a general
file or general data set. If FIND_GDS is not specified,
findc_ext accesses the record on the online database.
- Note:
- If the flag is not needed, the default extended options flag, FIND_DEFEXT,
should be coded. Consider using the findc function.
Normal Return
Void.
Error Return
Not applicable.
Programming Considerations
- The findc_ext 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()
- findc_ext() record X
- tx_suspend_tpf()
- findc_ext() 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.
- The TPF system 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.
- To ensure completion of the I/O, the requesting program must call
waitc following findc_ext. If an error has
occurred, waitc will return a nonzero value.
- TPF transaction services processing affects findc_ext
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.
- Finds from general files or general data sets are not considered part of
the commit scope and are not affected by commit scope processing.
- 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 a general data set to
level D7. The file address has already been calculated and resides in
the level D7 FARW. Note that FACS is not used to calculate file
addresses for general files or general data sets.
#include <tpfio.h>
·
·
·
findc_ext(D7,FIND_GDS);
Related Information