START
Indexed Files
| COBOL |
JAVA |
| START |
LocateRecordIndexedFile |
Syntax
LocateRecordIndexedFile ( <file>, <index>[, AmtLocate.<indexOperator>( <key> )] )
Parameters
- <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. |
Examples
| 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> )
Parameters
- <file>
- The name of the relative file.
- <recordNumber>
- The relative file key index.
Examples
| COBOL |
Java |
START RelativeFile.
|
FindRecnoInFile(Relativefile, m_LocDef.Relkey.Value);
|