gtpc2m2o | C/C++ Language Support User's Guide |
This function writes a working storage block from an entry control block
(ECB) data level to file. The ECB must be holding a storage block on
the specified level.
This service files a record to either VFA or DASD.
The filnc function does not return the block of storage to the
appropriate pool but retains it on the specified level following return from a
subsequent waitc.
Format
#include <tpfio.h>
void filnc(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
working storage block on this CBRW level is the record to be filed.
Normal Return
Void.
Error Return
Not applicable.
Programming Considerations
- The filnc function cannot be issued on a record that is part of
an ECB's suspended commit scope. The following sequence will cause
a system error:
- tx_begin()
- filnc() record X
- tx_suspend_tpf()
- filnc() record X
- The FARW at the specified level is unchanged.
- The program identification is placed in the record header.
- 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. 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.
- To ensure completion of the operation, waitc must be
executed.
- An error is posted during the execution of waitc only if the
prime duplicate copy of the record were not successfully updated.
- TPF transaction services processing affects filnc processing in
the following ways:
- Hardening to the DASD surface will only occur at commit time.
- When a group of updated records is hardened to DASD, the filing sequence
originally specified by the application program is maintained.
Therefore, applications that rely on a specific sequence of
filncand waitc function calls to control the order of
updates in a chain of related records will not lose this ability when placed
in a commit scope.
- Note:
- This guarantee of filing sequence only applies to file requests that are part
of the commit scope. It does not include filing to general
files or general data sets.
- When rollback occurs, filnc 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, processing
ends as if a rollback was issued.
- waitc processing does not report hardware errors when the
waitc function is issued in a commit scope.
Examples
The following example writes the data in the working storage block on level
DF to file. The working storage block remains attached to the data
level.
#include <tpfio.h>
·
·
·
filnc(DF);
if (waitc())
{
serrc_op(SERRC_EXIT,0x12345,"I/O ERROR OCCURRED",NULL);
}
/* This serrc_op call is the ISO-C version of the TARGET(TPF) call:
errno = 0x1234;
perror("I/O ERROR OCCURRED");
abort();
*/
Related Information