Open Data Base File (OPNDBF)

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

The Open Database File (OPNDBF) command opens a database file member. Processing of records is done later by application programs that do shared open operations.

Restrictions:

Top


 

Parameters

Keyword Description Choices Notes
FILE File Qualified object name Required, Positional 1
Qualifier 1: File Name
Qualifier 2: Library Name, *LIBL, *CURLIB
OPTION Open option *INP, *OUT, *ALL Required, Positional 2
MBR Member to be opened Name, *FIRST, *LAST Optional, Positional 3
OPNID Open file identifier Name, *FILE Optional, Positional 4
ACCPTH Access path to use *FILE, *ARRIVAL Optional
SEQONLY Limit to sequential only Element list Optional
Element 1: Sequential only *NO, *YES
Element 2: Number of records Integer
COMMIT Commitment control active *NO, *YES Optional
OPNSCOPE Open scope *ACTGRPDFN, *ACTGRP, *JOB Optional
DUPKEYCHK Duplicate key check *NO, *YES Optional
TYPE Type of open *NORMAL, *PERM Optional

Top

 

File (FILE)

Specifies the file that contains the member to be opened. Overrides currently in effect are processed.

This is a required parameter.

Qualifier 1: File

name

Specify the name of file.

Qualifier 2: Library

*LIBL

All libraries in the library list for the current thread are searched until the first match is found.

*CURLIB

The current library for the job is used to locate the file. If no library is specified as the current library, QGPL is used.

name

Specify the name of the library to be searched.

Top

 

Open option (OPTION)

Specifies the options to use to open a file. The options chosen on the first full open operation of a file are not changed on subsequent shared options.

This is a required parameter.

*INP

The file is opened only for input operations.

*OUT

The file is opened only for output operations.

*ALL

The file is opened for all operations (input, output, update, and delete).

Top

 

Member to be opened (MBR)

Specifies the member to open in the database file.

*FIRST

The first member of the specified file is used.

*LAST

The last member created in the file is opened.

member-name

Specify the name of the member to be opened.

Top

 

Open file identifier (OPNID)

Specifies the identifier used for naming this open operation so it can be referred to when the member is closed or positioned. This identifier must be specified on the Close File (CLOF) command, and on the Position Database File (POSDBF) command. It is not used on another Open Database File (OPNDBF) command until the file is closed, or an escape message is sent and the open operation fails.

*FILE

The file name is used for the open operation identifier.

name

Specify the name used to identify this open operation.

Top

 

Access path to use (ACCPTH)

Specifies which access path to use for this open operation.

*FILE

The file access path is used. If the file is keyed, the keyed access path is used; otherwise, the arrival sequence path is used.

*ARRIVAL

The arrival sequence access path is used. If the file is keyed, the keyed access path is ignored.

Top

 

Limit to sequential only (SEQONLY)

Specifies, for database files whose records are normally processed in sequential order, whether sequential-only processing is used on the file. This parameter also specifies the number of records transferred as a group to or from the database file if sequential-only processing is used. If an override specifying sequential only processing is in effect, it takes precedence over what is specified on this parameter.

If *ALL is specified for the Open option (OPTION) parameter or *YES is specified for the Commitment control active (COMMIT) parameter, the *NO value is used for this parameter.

Element 1: Sequential only

*NO

The database file does not use sequential-only processing.

*YES

The database file uses sequential-only processing.

Element 2: Number of records

integer

The file uses sequential-only processing. This parameter value indicates the number of records the database blocks up in its internal buffer before actually accessing the data in the member. Specifying this number is not required. If this value is not specified, the database chooses a default value.

Top

 

Commitment control active (COMMIT)

Specifies whether this file is placed under commitment control.

Before a database file is opened under commitment control, the user must ensure that all files in the commitment transaction are journaled. If only the after images are being journaled, the system implicitly begins journaling both the before and the after images for the duration of the changes being made to files opened under this commitment definition.

*NO

This file is not placed under commitment control.

*YES

This file is placed under commitment control.

Top

 

Open scope (OPNSCOPE)

Specifies the extent of influence (scope) of the open operation.

*ACTGRPDFN

The scope of the open operation is determined by the activation group of the program that called the OPNDBF command processing program. If the activation group is the default activation group, the scope is the call level of the caller. If the activation group is a non-default activation group, the scope is the activation group of the caller.

*ACTGRP

The scope of the open data path (ODP) is the activation group. Only those shared opens from the same activation group can share this ODP. This ODP is not reclaimed until the activation group is deactivated, or until the Close File (CLOF) command closes the activation group.

*JOB

The scope of the open operation is the job in which the open operation occurs.

Top

 

Duplicate key check (DUPKEYCHK)

Specifies whether duplicate key checking is done on input and output operations opened by this command.

*NO

No duplicate key feedback is provided on input and output commands.

*YES

Duplicate key feedback is provided on input and output commands.

Top

 

Type of open (TYPE)

Specifies the recursion level at which the reclaim resources function (RCLRSC) is effective.

This parameter is not valid when the Open scope (OPNSCOPE) parameter is specified.

*NORMAL

Allow the reclaim resources function to close the file if the program exits without doing a close operation.

*PERM

The file remains open until a close operation is done using the Close File (CLOF) command, or until the routing step ends. The open data path (ODP) remains in existence even if the Reclaim Resources (RCLRSC) command is used.

Top


 

Examples

 OPNDBF   FILE(MASTER/PAYROLL)  OPTIONS(*INP)

This command opens the first member in the file PAYROLL for input processing. The open identifier associated with this open operation has the file name as its identifier. If the file is specified as SHARE(*YES), subsequent open operations of the file PAYROLL (such as in an application program) perform more efficiently and use the same ODP.

Top


 

Error messages

*ESCAPE Messages

CPF4125

Open of member &3 file &1 in &2 failed.

CPF4174

OPNID(&4) for file &1 already exists.

CPF4175

Output only and MBR(*ALL) cannot be used together.

CPF4176

File &1 in &2 not a data base file.

CPF432A

Open not allowed under commitment control; reason code &8.

CPF4327

Commitment control resource limit exceeded.

CPF4328

Member &4 not journaled to journal &6.

CPF4329

Cannot associate journal &6 with commitment definition &9.

CPF8361

Cannot place resource under commitment control. Reason code &1.

CPF8367

Cannot perform commitment control operation.

Top