gtpc2m2r | C/C++ Language Support User's Guide |
This function writes a working storage block from an entry control block
(ECB) data level to file and releases it from exclusive control (unholds it)
from the requesting ECB. The ECB must be holding a storage block on the
specified level.
This service files a record to either VFA or DASD.
The filuc_ext function returns the block of storage to the
appropriate pool that is referred to in the CBRW at the specified
level.
Format
#include <tpfio.h>
void filuc_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
working storage block on this core block reference word (CBRW) level is the
record to be filed.
- ext
- Sum of the following bit flags, that are defined in
tpfio.h.
- FILE_GDS
- Use FILE_GDS to specify that the record to be filed and unheld resides in
a general file or general data set. If FILE_GDS is not specified,
filuc_ext accesses the record on the online database.
- FILE_NOTAG
- The TPF system code that places the program identification in the record
header is bypassed. This flag should only be used when the application
updating the record has placed the required program identification in the
header directly.
- Note:
- If neither of the above flags are needed the default extended options flag,
FILE_DEFEXT, should be coded. Consider using the filuc
function.
Normal Return
Void.
Error Return
Not applicable.
Programming Considerations
- The filuc_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()
- filuc_ext() record X
- tx_suspend_tpf()
- filuc_ext() record X.
- The specified CBRW is initialized to indicate that a block of storage is
no longer held. Specifying an invalid data level results in a system
error with exit.
- The FARW at the specified level is unchanged, but the file copy of the
record is now available to other ECBs requesting exclusive control
(hold).
- If you specify FILE_NOTAG, the TPF system bypasses the system code that
updates the record header with the program identification. If you omit
FILE_NOTAG, the TPF system places the program identification in the record
header.
- 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. In addition, the record type at the specified
level is checked with the record type in the record. If any condition
is violated, control is transferred to the system error routine. When
the record code check in the FARW is zero, the control program ignores
verification of the record code check. If the record code check is
nonzero, the TPF system verifies that the code specified in the FARW is the
same as the code in the header of the record. If the codes are not
equal, control is transferred to the system error routine.
- The block of storage containing the data to be stored is no longer
available to the operational program. The operational program can use
the specified CBRW immediately upon return from the function.
- The status of the operation can never be determined by the operational
program.
- TPF transaction services processing affects filuc_ext
processing in the following ways:
- Hardening to the DASD surface will only occur at commit time.
- When rollback occurs, filuc_ext changes are discarded and
hardening does not occur. The DASD surface remains unchanged.
- If a system error occurs because of an ID or record code check (RCC),
processing ends as if a rollback was issued.
- When the file address returns from the filuc_ext call, it
appears to be unheld from the point of view of the program. For
requests from outside the commit scope, the file address still appears to be
held. When the commit has completed successfully, the file address will
be unheld and any waiting requests will be serviced.
- Files to general files or general data sets are not considered part of the
commit scope and are not affected by commit scope processing.
- Note:
- If a request is waiting to hold the same record, it is serviced by the
execution of a storage-to-storage move. This gives the waiting ECB
faster access to the record.
Examples
The following example writes the data in the working storage block on level
D7 to a general data set, bypasses the record header update, and releases the
block.
#include <tpfio.h>
·
·
·
filuc_ext(D7,FILE_GDS|FILE_NOTAG);
Related Information