FPOSITA
9.1
The FPOSITA instruction retrieves the current AAM index position. It uses one of the following formats:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
afile
Required. A previously defined and opened AFILE definition whose current index position is returned.
pos
Required. A previously defined Character String Variable that receives the current index position data.
Flags Affected: none
Note the following:
All data stored in {pos} is required by the REPOSITA instruction to restore the AAM index position. This allows the READKG or READKGP instructions to be performed without having to execute a READ AAM with key instruction.
The data stored in {pos} is composed of two basic sets of components. The first
set of components is the basic parameters required to reset the AAM index position. The second set of
components is the user key data strings that are in use for the AFILE
when the FPOSITA instruction is executed. The size of the {pos} is determined
by the size of the two sets of components. The size of the first set depends on the operating system
where the runtime is being executed. The size of the second set of key data depends on the user application
keys that are in use when the FPOSITA is executed.
The size of {pos} can be calculated as follows:
possize = indexsize + keysize1 + keysize2...+ keysizeN
Where:
indexsize
The size of the AAM index data that is required to restore the AAM index position. This size depends
on the OS where the runtime is executed (Windows runtimes - 24 bytes).
keysize1
The size of the first user key string plus one.
keysize2
This is the size of the second user key string plus one.
keysizeN
The size of the Nth user key string plus one.
Example:
The minimum size of AAMPOS is calculated as follows when using a Windows
runtime and the key as shown:
size = 24 + 7 = 31
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The FPOSITASIZE keyword of the GETFILE instruction returns the minimum size required for the {pos} based on the current key values.
An I29 runtime error can occur during the execution of the FPOSITA instruction. Subcodes help identify the specific problem.
See Also: REPOSITA, Disk I/O Instructions
![]() |