FORTRAN Reference Manual
Statements
FORTRAN Reference Manual—528615-001
7-83
POSITION Statement
skip
is a character expression whose value is either 'YES' or 'NO'. The default value 
is 'NO'.
Considerations
•
A POSITION statement establishes the record to access on the next READ or 
WRITE statement. The POSITION statement does not perform I/O operations, nor 
does it check for the existence of the specified record. The file is positioned to the 
specified record when your program executes the next data transfer statement. For 
more information about positioning structured files, see the ENSCRIBE 
Programmer’s Guide.
•
You can code the control specifiers in any order, except that if you omit the UNIT 
keyword from the unit specifier, the UNIT specifier must be the first item in the list.
•
If you use the KEY specifier, you must also specify values for KEYLEN, KEYID, 
and MODE. The file must be a relative, entry-sequenced, or key-sequenced file. 
The key can be an alternate key for any of the allowed file types, or the primary 
key of a key-sequenced file. For additional information, see Section 5, Introduction 
to File I/O in the HP NonStop Environment.
•
KEYLEN specifier
If you omit the KEYLEN specifier, the compiler uses the actual length of the key 
field.
•
KEYID specifier
If you use an alternate key to position the file, kid must be a character expression 
having a value equal to the two-character ENSCRIBE key tag defined for the 
alternate key.
If you use the primary key to position the file, kid must be either 0 or blank.
If you omit this specifier, the compiler assumes a value of 0.
•
MODE specifier
If you specify 'APPROXIMATE', ENSCRIBE uses the specified key as the full or 
partial value of the key that starts the sequential reading of the file. The system 
detects an end-of-file condition when it reaches the end of the file.
If you specify 'GENERIC', ENSCRIBE uses the specified key as the full or partial 
value of the key that starts the sequential reading of the file. The system detects an 
end-of-file condition when the record key no longer matches key for the specified 
key length. 'EXACT' is the same as 'GENERIC', except that ENSCRIBE interprets 
key as the full value of the key to be used. 
The default value is 'APPROXIMATE'.
•
COMPARELEN specifier










