START
Indexed Files
COBOL | JAVA |
START | LocateRecordIndexedFile |
Syntax
LocateRecordIndexedFile ( <file>, <index>[, AmtLocate.<indexOperator>( <key> )] )
Parameter(s)
<file>
The name of the indexed file.
<index>
The name of the key as set in the file ID.
<locateValues>
The operators to use with an optional key data field.
<key> (Optional)
Key data field name
Operators |
---|
The following index operators can be used: createEqual, createGreater, createGreaterEqual. |
Example(s)
COBOL | Java |
START IndexedFile. |
locateRecordIndexedFile(indexedfile, idx_Idxkey); |
START IndexedFile KEY IS GREATER THAN Datakey |
locateRecordIndexedFile(indexedfile, idx_Idxkey, FileLocate.createGreater(fd_Idxdata.idxkey)); |
START IndexedFile KEY >= Datakey INVALID MOVE 'Error: Invalid key' TO FILESTATUS. |
if (!(locateRecordIndexedFile(indexedfile, idx_Idxkey, FileLocate.createGreaterEqual(fd_Idxdata.idxkey)))) { locDef.filestatus.assign("Error: Invalid key"); } |
Relative Files
COBOL | JAVA |
START | FindRecnoInFile |
Syntax
FindRecnoInFile ( <file>, <recordNumber> )
Parameter(s)
<file>
The name of the relative file.
<recordNumber>
The relative file key index.
Example(s)
COBOL | Java |
START RelativeFile. |
FindRecnoInFile(Relativefile, m_LocDef.Relkey.Value); |