filec–File a record: basic

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 filec function returns the block of storage to the appropriate pool that is referred to in the CBRW at the specified level.

Format

#include   <tpf/tpfio.h>
void       filec(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 core block reference word (CBRW) level is the record to be filed.

Normal return

Void.

Error return

Not applicable.

Programming considerations

  • The filec function cannot be issued on a record that is part of the suspended commit scope of the ECB. The following sequence will cause a system error:
    1. tx_begin()
    2. filec() record X
    3. tx_suspend_tpf()
    4. filec() record X.
  • The specified data level 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.
  • The program identification is placed in the record header.
  • The z/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 z/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 on return from the function.
  • The status of the operation can never be determined by the operational program.
  • z/TPF transaction services processing affects filec processing in the following ways:
    • Hardening to the DASD surface will occur only at commit time.
    • When rollback occurs, filec 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.

Examples

The following example writes the data in the working storage block on level D4 to file and releases the block.
#include <tpf/tpfio.h>
⋮
filec(D4);

Related information

See z/TPF C functions overview for more information about z/TPF C/C++ language support.