POSDBF (Position Database File)

POSDBF Command syntax diagram

 

Purpose

The Position Database File (POSDBF) command allows the user to set the position of a database file to either the beginning or end of an open file.

 

Required Parameters

OPNID
Specifies which opened file changes position. This file must be opened by either the Open Database File (OPNDBF) or Open Query File (OPNQRYF) command.

POSITION
Specifies the starting or ending position of the database file.

*START: The position of the database file is set to the start position of the member currently open. After the start position is set, a read next operation gets the first record in the current member. If the Override Database File (OVRDBF) command MBR(*ALL) processing is in effect, a read previous operation gets the last record in the previous member. If a read previous is done and the previous member does not exist, the end of the file message (CPF5001) is sent.

*END: The position of the database file is set to the end of the member that is currently open. After the end position is set, a read previous operation gets the last record in the current member. If the Override Database File (OVRDBF) command MBR(*ALL) processing is in effect, a read next operation gets the first record in the next member. If a read next is done and the next member does not exist, the end of the file message (CPF5001) is sent.

Example for POSDBF

POSDBF  OPNID(XXX)  POSITION(*START)

This command sets the record position of the database file that is opened with OPNID(XXX) to the starting position of the database file member that is currently open.

Error messages for POSDBF

*ESCAPE Messages

CPF5213
Positioning of member &3 failed.
CPF5230
No file open with OPNID(&4).