Position Data Base File (POSDBF)

Where allowed to run: All environments (*ALL)
Threadsafe: Yes
Parameters
Examples
Error messages

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

Top

Parameters

Keyword Description Choices Notes
OPNID Open file identifier Name Required, Positional 1
POSITION File position *START, *END Required, Positional 2
Top

Open file identifier (OPNID)

Identifies the opened file to reposition. This file must be opened by either the Open Database File (OPNDBF) or Open Query File (OPNQRYF) command.

This is a required parameter.

name
Specify the open file identifier.
Top

File position (POSITION)

Specifies the starting or ending position of the database file.

This is a required parameter.

*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 member. A previous read operation gets the last record in the previous member, if *ALL is specified for the Overriding member (MBR) parameter of the Override with Database File (OVRDBF) command. Otherwise, a get past start of file exception occurs.
*END
The position of the database file is set to the end of the member currently open. After the end position is set, a read next operation gets the first record in the next member, if *ALL is specified for the MBR parameter of the Override with Database File (OVRDBF) command. Otherwise, a get past end of file exception occurs. A read previous operation gets the last record in the member.
Top

Examples

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.

Top

Error messages

*ESCAPE Messages

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