gtpc2m21 | C/C++ Language Support User's Guide |
This function initializes a FARW with the data necessary to access a fixed file record.
Format
#include <tpfio.h> void FACE(struct TPF_regs *regs); void FACS(struct TPF_regs *regs);
Normal Return
regs.r0 contains the maximum ordinal number for the requested record type. regs.r6 and regs.r7 are destroyed. The file address has been placed in the FARW specified on input by regs.r7.
Error Return
regs.r0 contains zero. regs.r7 contains a general error type indicator, and regs.r6 contains a specific error type indicator within the general type indicated by regs.r7:
MYRECIDS CSECT , NOLABEL DS F The utility requires a field to in order \ to create a structure. MYRECIDS , The EQUs will be converted to #defines. END ,and processing it using the DSECT Conversion Utility with parameters: EQU(DEF) NOLC SEQ UNN will produce a C source file containing a structure (for NOLABEL) and #defines for all of the equates in MYRECIDS, consistent with the record type #defines in <c$sysequ.h>.
Examples
The following example generates a SON address for '#PROG1' record number 235 and stores it in the FARW for data level D6.
#include <tpfio.h>
·
·
·
struct TPF_regs regs; regs.r0 = 235; regs.r6 = (long int)"#PROG1 "; regs.r7 = (long int)&ecbptr()->ce1fa6; FACS(®s); if (regs.r0 != 0) { /* Success, regs.r0 contains the maximum record ordinal for */ /* for #PROG1 fixed file records, ce1fa6 contains the file */ /* address. */
·
·
·
} else /* Determine type of error */ { switch (regs.r7) { case 1: /* The record type indicator is invalid. */ switch (regs.r6) { case 1: /* The requested record type is not in use. */ break; case 2: /* The record type is not defined or exceeds the limit. */ break; case 3: /* There are no records defined for the record type for */ /* the associated SSU. */ break; } break; case 2: /* The input ordinal number is outside allowable range. */ if (regs.r6 == 0) { /* The ordinal number exceeds the record type limit. */ } else { /* The requested ordinal does not exist but does not */ /* exceed the maximum. regs.r6 contains the next valid */ /* ordinal following the requested one. (This return is */ /* valid for pools with PSON gaps). */ } } }
Related Information