gtpc2m2nC/C++ Language Support User's Guide

file_record_ext-File a Record with Extended Options: Higher Level

This service files a record to either virtual file access (VFA) or DASD.

Format

#include   <tpfio.h>
void       file_record_ext(enum t_lvl level, const unsigned int *address,
                           const char *id, unsigned char rcc,
                           enum t_act type, unsigned int ext);

or

#include   <tpfio.h>
void       file_record_ext(TPF_DECB   *decb, TPF_FA8 *fa8,
                           const char *id, unsigned char rcc,
                           enum t_act type, unsigned int ext);

level
One of 16 possible values representing a valid entry control block (ECB) 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.

decb
A pointer to a data event control block (DECB). The working storage block anchored off the CBRW of the DECB is the record to be filed.

address
A pointer to the file address indicating where the record will be filed.

fa8
A pointer to an 8-byte file address indicating where the record will be filed.

id
A pointer to a 2-character record ID string that must match the ID characters in the record to be filed. This check can be bypassed by coding the term RECID_RESET, defined in tpfio.h.

rcc
An unsigned character that represents the value to be assigned to the record code check (RCC) field of the record being filed.

type
The disposition of the record's hold status, or the associated working block. This parameter must belong to the enumeration type t_act, defined in tpfio.h.

NOHOLD
The record is not in hold status and the associated working storage block can be returned to the system.

UNHOLD
The record is in hold status and the associated working storage block can be returned to the system.

NOREL
The record is not in hold status and the associated working storage block should not be returned to the system.

ext
Logical or (|) of the following bit flags that are defined in tpfio.h.

FILE_GDS
Use FILE_GDS to specify that the record to be filed resides in a general file or general data set. If FILE_GDS is not specified, file_record_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 flags FILE_GDS or FILE_NOTAG are not needed, code the default extended options flag, FILE_DEFEXT. Consider using the file_record function.

Normal Return

Void. The associated working storage buffer block has been made unavailable to the operational program. For NOREL calls, the buffer block will be available to the operational program following a subsequent waitc call.

Error Return

Not applicable.

Programming Considerations

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. The id is CD, the rcc is zero, and the file address is taken from the forward chain field of another record. On return, the file copy of the record is available to other ECBs.


  ·
  ·
  ·
file_record_ext(D7,(const unsigned int *)&(inm->im0fch),CD,'\0', UNHOLD,FILE_NOTAG|FILE_GDS);

The following example writes the data in the working storage block on a DECB and unholds the record. The file address and record id are specified in the DECB.

#include <tpfio.h>
 
TPF_DECB	*decb

  ·
  ·
  ·
file_record_ext(decb, NULL, NULL, '\0', UNHOLD, FILE_NOTAG);

Related Information

See TPF Application Programming for more information about DECBs.