OPRB - Database Open/Close Processing

This Natural profile parameter controls the use of database open/close commands during a Natural session that accesses an Adabas or VSAM database.

The NTOPRB macro can be used as an alternative to the profile parameter OPRB in the NTPRM macro. The maximum length of an OPRB parameter specification is 256 bytes. If you require a longer specification, use the NTOPRB macro instead of the OPRB parameter.

Possible settings See OPRB Parameter Syntax.
Default setting none  
Dynamic specification yes  
Specification within session no  


  1. The Natural profile parameter OPRB and the corresponding macro NTOPRB only apply to Adabas and VSAM databases.
  2. Generally, the OPRB parameter uses one of the above syntaxes (the possible contents of the strings depend on the database system).
  3. Instead of using the OPRB parameter, you can also use the macro NTOPRB in the Natural parameter module.
  4. If you wish to make OPRB specifications that are to apply to all databases, it is strongly recommended that you use the OPRB parameter in the NTPRM macro (and not an NTOPRB macro).

The following topics are covered below:

OPRB Parameter Syntax

The OPRB parameter is specified as follows:

Variant 1 - Open Request for All Databases


With this syntax you specify an open request for all databases.

Variant 2 - Open Request for Specific Databases


With this syntax you specify an open request for specific individual databases. As defined in the macro NTDB, the specified DBID identifies the type of database.

Variant 3 - Open Request for Specific Databases and Default Open Request for All Others Not Specified Explicitly


With this syntax you specify an open request for specific individual databases (string2 and string3) and also a default open request - the initial string1- which applies to all databases for which you do not specify an individual string.

Variant 4 - Open Request Using a (Non-)Restricted Call


With the subparameter NR=value you specify whether the Adabas open command OP is to be executed as a restricted or non-restricted call. This controls the value set in the Command Option 1 (COPT1) of the open command OP.


Value Explanation
NR=OFF Causes a restricted open, with COPT1=R.

This is the default value.

NR=ON Causes a non-restricted open, when COPT1 is left empty.

Dynamic OPRB with Natural Security

A dynamically specified OPRB parameter applies for all logons to libraries in whose security profiles no OPRB parameter is specified. For a logon to a library in whose security profile the OPRB parameter is specified, any dynamically specified OPRB parameter is ignored, and the one from the security profile applies.


The strings which can be specified for VSAM databases are described under OPRB Parameter for VSAM Databases in the Natural for VSAM documentation.

OPRB for Adabas

For Adabas databases, the OPRB parameter is required if either of the following conditions are true for the Natural session:

  • An explicit list of Adabas files to be accessed/updated is to be provided. This is necessary, for example, if Adabas cluster updating or exclusive file control is to be requested.

  • A single logical transaction is to span two or more Natural programs and, therefore, it is not desired to have Natural issue an END TRANSACTION and CL (close) command at the termination of any given Natural program.

Possible Content of Parameter String Explanation
ACC=(file-list) Specifies access permission (read) for the files in the file list.
UPD=(file-list) Specifies access/update permission (read/write) for the files in the file list.
EXF=(file-list) Specifies exclusive file control: no other users may access/update the file.
EXU=(file-list) Specifies exclusive update permission (exclusive read/write) for the files in the file list.
ACODE Specifies the option to enforce a user encoding for A fields.

The required encoding code for ACODE is derived from the current CP parameter setting of the Natural session.

WCODE Specifies the option to enforce a user encoding for W fields.

The required encoding code for WCODE is always 4095.

ARC Defines a special data architecture for fields in the record and value buffers. This definition overrides the architecture key defined for remote calls in Entire Net-work.


  1. For further information on these settings, refer to the description of the Adabas OP command in the Adabas Command Reference documentation.
  2. If the OPRB parameter is omitted in the Natural parameter module or OPRB=OFF is specified as a dynamic parameter, a Natural session commences with an Adabas open command requesting UPD (access/update) to the Natural system file. Natural also issues RELEASE CID (Adabas RC) commands to release all ISN lists (ISN lists specified in a RETAIN clause of a Natural FIND statement are not released).

The Adabas record buffer to be used with the initial Adabas OP command can be explicitly provided. The format is similar to that used in an Adabas record buffer for the OP command with the exception that no blanks can be embedded, and the complete setting must be enclosed in parentheses (not apostrophes).

Example 1:

This specifies that Adabas Files 2,4 and 6 are to be made available for access only and that Adabas File 8 is to be made available for update (which also implies access).

Example 2:

This specifies that Adabas Files 1,2 and 3 are to be placed under exclusive control for this Natural session.

Combinations of the keywords ACC, UPD and EXU must follow the rules as defined in the relevant Adabas documentation. When these keywords are coded, Natural issues an OP command at the start of a Natural session and a CL at the end of the Natural session. At the end of a Natural program, only the required RC commands are issued to release held ISN lists.

In all of the above situations, the OP command, which is always issued at the start of a Natural session, contains the user ID for the Natural session in the Additions 1 field of the Adabas control block. In batch mode, this is the job name. In TP mode, this is the setting supplied at system initialization by the Natural interface module. In both cases, the setting used is available in the Natural system variable *INIT-USER.

NTOPRB Macro Syntax

The syntax of the NTOPRB macro is as follows:

         NTOPRB dbid,'string'


  1. For possible values, see the OPRB parameter; if you use Natural with VSAM, see also the Natural for VSAM documentation.
  2. If string is very long, it can be divided in up to five strings separated by commas (see examples below), as the Assembler allows single strings up to 256 bytes only.

Examples of NTOPRB Macros

         NTOPRB 12,'ACC=40,UPD=20' 
         NTOPRB 15,'EXU=1,','2,3'