IFILE
ANSI
The IFILE and RIFILE instructions define an index sequential file. These files may be read by index keys directly, as well as sequentially forward and backwards. Individual records may be read, written, updated (in place) or deleted by a particular index key. IFILEs and RIFILEs may be read sequentially and randomly. Their definition uses one of the following formats:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
%
Optional. Denotes the item as being GLOBAL.
*
Optional. Denotes the item as being COMMON.
arraysize
Optional. An Integer decimal constant, CONST variable or equated value indicating the number of array items.
target
Optional. A previously declared IFILE variable that initializes the array.
parm
Optional. One of the valid parameters listed below.
^
Optional. Denotes the item as being a POINTER.
label
Optional. The name of a previously defined data item of the same type.
%%
Optional. Denotes the item as GLOBAL but does not initialize it in any way.
Flags Affected: NONE
Note the following:
An IFILE/RIFILE label must have been defined with a File Definition instruction before being referenced in an instruction. An RIFILE is treated as an IFILE by any instruction.
IFILE/RIFILE definitions reference two physical files on the system. These files perform particular functions within the ISAM implementation as follows:
|
Type |
Use |
|
TXT |
The data file containing all of the text records for this IFILE/RIFILE. |
|
ISI |
The index to the records in the TXT file. It also monitors deleted record space for re-use, when appropriate and contains the TXT file name and path. |
{parm} is optional. The supported parameters are:
BUFFER={nnnn | nvar | exp}
COMP or COMPRESSED
DUP or DUPLICATES
DYNAMIC
FIX={nnnn | nvar | exp} or FIXED={nnnn | nvar | exp}
FORMAT={MSDOS | UNX | BINARY}
NAME={value}
NODUP or NODUPLICATES
NOPATH
UNCOMP or UNCOMPRESSED
UPPER or UPPERCASE
VAR={nnnn | nvar | exp} or VARIABLE={nnnn | nvar | exp}
VIEW={viewname}
WEOF
Additional parameters supported when using Datapoint Corporation's RMS Remote Access Server (RMSRAS) are as follows:
FORMAT={BINARY | BIT8 | RMS | RMSUNCOMP}
INCREMENT={nn}
ISAMBUFFS={nn}
KEYLENGTH={nn}
LENGTH={nn}
STATIC={nn}
Where applicable, more than one option may be specified, such as:
BUFFER and COMPRESSED
FIXED and WEOF
BUFFER, NODUP and UPPERCASE
If the operand field begins with an asterisk (*), the file is a Common Data Item. An attempt is made to maintain the OPEN status (with existing file pointers intact) of a corresponding file declaration in the program that initiated the chain. However, if the UDA of the chained to program is not in alignment (same File Definition types, sizes, and locations) with those in the program that initiated the CHAIN, a CHAIN error occurs.
Most parameters specified on the IFILE definition are overridden at execution by the actual characteristics of the file. The exception to this rule is the actual (maximum if variable length or space compressed records) record length specified with BUFFER, FIXED or VARIABLE parameters.
Care should be used if performing UPDATEs against variable length or space compressed records. UPDATEs are not recommended with space compressed data files.
When an ISAM or AAM file is created with variable length or space compressed records, all secondary ISIs and AAMs should be created with the same characteristics.
The ^ denotes a Pointer Variable.
If the % form is used, the data item is placed in the Global Data Area. The variable would be available to other programs that also declared it with the percent form. Global Data Items are available with PLBCMP only.
If the %% form is used, the data label is placed in the Global Data Area but no initialization takes place if it has not already been defined in the Global Data Area. Global Data Items are available with PLBCMP only.
Array definition and referencing is handled in the same manner as DIM variables.
An IFILE array variable may be declared within a FILELIST/FILELISTEND declaration.
See Also: Example Code, File Definition, Disk I/O Instructions
![]() |