Command reference / db
OVRDBF
Override with Data Base File
Overrides a file named in the program in one of two ways: it replaces that file with another database file (TOFILE), or it keeps the file and changes some of its parameters (TOFILE(*FILE)). It applies to physical, logical, and DDM files. Overrides take effect when the file is next used, not immediately, and parameters you leave out keep their earlier settings. Not every command can be overridden.
Allowed environments: *ALL.
Positional parameters: 3.
Restrictions
- In a multithreaded job, the command can be issued only from the initial thread.
- In a multithreaded job, only overrides scoped to the activation group or job affect opens made from secondary threads.
Parameters
FILE
File being overridden
Names the file in the using program that the override applies to. It must be a database file when TOFILE(*FILE) is used; otherwise any device or database file can be named. This parameter is required.
TOFILE
Overriding to data base file
Names the database file used in place of FILE. Specify *FILE instead to keep FILE and override only the attributes given on this command.
*FILE- FILE keeps its identity, but some of its parameters are overridden by this command.
*LIBL- Searches every library in the thread's library list until the first match is found.
*CURLIB- Uses the job's current library to locate the file; QGPL if no current library is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Overriding to data base file
Overriding to data base file
Library
Library
Suggested / special values:
*LIBL, *CURLIB
MBR
Overriding member
Names the member that is used when the file is opened. If omitted and TOFILE is not *FILE, the first member is used. Not valid for some DDM files.
Suggested / special values:
*FIRST, *LAST, *ALL
*FIRST- The first member of the database file is used.
*LAST- The last member of the database file is used.
*ALL- All members are processed in order, each opened with the same override parameters as the first. EOFDLY, FMTSLR, INHWRT, and POSITION cannot be specified with it.
POSITION
Starting position in file
Sets where reading starts: at the beginning or end of the file, at a relative record number, or at a key-value search. Cannot be specified after MBR(*ALL).
*NONE- No special positioning; the first input/output operation determines which record is read.
*START- Starts at the first record; a read-previous operation gives end-of-file.
*END- Starts at the last record; the next read reaches end-of-file, and a read-previous returns the last record.
*RRN- Starts at the relative record number given as the second element.
Elements in order
Retrieve order
Retrieve order
Allowed values:
*RRN, *KEYB, *KEYBE, *KEY, *KEYAE, *KEYA
*RRN-rcd nbr *KEY-nbr key flds
*RRN-rcd nbr *KEY-nbr key flds
*KEY-rec format having key
*KEY-rec format having key
*KEY-key value
*KEY-key value
RCDFMTLCK
Record format lock
Elements in order
Record format
Record format
Lock state
Lock state
Allowed values:
*SHRRD, *SHRNUP, *SHRUPD, *EXCLRD, *EXCL
FRCRATIO
Records to force a write
Suggested / special values:
*NONE
FMTSLR
Rcd format selector program
Qualified parts (object, then library; write LIBRARY/OBJECT)
Rcd format selector program
Rcd format selector program
Library
Library
Suggested / special values:
*LIBL, *CURLIB
WAITFILE
Maximum file wait time
Seconds to wait for file resources at open, or for device or session resources at acquire; an error is sent if they are not allocated in time. Integer range 1 to 32767.
Suggested / special values:
*IMMED, *CLS
*IMMED- Does not wait; attempts an immediate allocation.
*CLS- Uses the default wait time from the class description.
WAITRCD
Maximum record wait time
Seconds to wait for a record to be updated or deleted, or for a read under commitment control with LCKLVL(*ALL); an error is sent if not allocated in time. Integer range 1 to 32767.
Suggested / special values:
*IMMED, *NOMAX
*NOMAX- Waits indefinitely for the record lock.
*IMMED- Does not wait; the lock is obtained immediately when the record is read.
REUSEDLT
Reuse deleted records
Allowed values:
*NO
NBRRCDS
Records retrieved at once
EOFDLY
EOF retry delay in sec
Suggested / special values:
*NONE
LVLCHK
Record format level check
Allowed values:
*NO
EXPCHK
Check expiration date
Whether the expiration date of a physical file member is checked. This overrides the setting in the program or in earlier overrides.
Allowed values:
*YES, *NO
*YES- The expiration date is checked; if it has passed, an escape message is sent to the program.
*NO- The expiration date is not checked.
INHWRT
Inhibit write
Whether processed records are written, deleted, or updated in the database. Useful for testing a program without storing its changes. Cannot be specified with MBR(*ALL).
Allowed values:
*YES, *NO
*YES- Records are not written to the database; they go only to an output device.
*NO- Records are written normally, except in debug mode with UPDPROD(*NO) in a production library, where an escape message is sent.
SECURE
Secure from other overrides
Allowed values:
*NO, *YES
OVRSCOPE
Override scope
Sets the extent of influence (scope) of the override.
Allowed values:
*ACTGRPDFN, *CALLLVL, *JOB
*ACTGRPDFN- Scope comes from the activation group: the call level in the default activation group, otherwise the activation group.
*CALLLVL- Scope is the current call level; opens at that level or higher are affected.
*JOB- Scope is the job in which the override occurs.
SHARE
Share open data path
Whether the open data path (ODP) is shared with other programs in the same routing step, including file status and buffers.
Allowed values:
*NO, *YES
*NO- A new ODP is created each time a program opens the file.
*YES- The same ODP is shared with each program in the job that also specifies *YES when opening the member.
OPNSCOPE
Open scope
Allowed values:
*ACTGRPDFN, *JOB
SEQONLY
Limit to sequential only
For files processed only in sequential order, sets whether sequential-only processing is used and how many records move as a group. Overrides earlier settings.
*NO- The file is not restricted to sequential-only processing.
*YES- The file uses sequential-only processing, with the number of records per group chosen by the system unless given.
*BUF32KB- Buffer size of 32 KB.
*BUF64KB- Buffer size of 64 KB.
*BUF128KB- Buffer size of 128 KB.
*BUF256KB- Buffer size of 256 KB.
Elements in order
Sequential only
Sequential only
Allowed values:
*YES
Number of records
Number of records
Suggested / special values:
*BUF32KB, *BUF64KB, *BUF128KB, *BUF256KB
DSTDTA
Distributed Data
Allowed values:
*BUFFERED, *PROTECTED, *CURRENT
Examples
OVRDBF FILE(ORDERSIN) MBR(MONDAY)
When ORDERSIN is opened, member MONDAY is processed instead of the one previously specified.
OVRDBF FILE(INPUT) TOFILE(PAYROLL) MBR(MBR1) RCDFMTLCK((EMPDATA *EXCL))
INPUT is replaced by PAYROLL, member MBR1 is used, and an exclusive (*EXCL) lock is placed on record format EMPDATA.
Generated from os/cl/catalog/OVRDBF.json and os/cl/help/OVRDBF.json.