Previous Topic: ACCEPT DB-KEY RELATIVE TO CURRENCYNext Topic: ACCEPT STATISTICS


ACCEPT PAGE-INFO

Purpose

The ACCEPT PAGE-INFO statement moves the page information for a given record to a specified location in program variable storage. Page information that is saved in this manner is available for subsequent direct access by using a FIND/OBTAIN DB-KEY statement.

The dbkey radix portion of the page information can be used in interpreting a dbkey for display purposes and in formatting a dbkey from page and line numbers. The dbkey radix represents the number of bits within a dbkey value that are reserved for the line number of a record. By default, this value is 8, meaning that up to 255 records can be stored on a single page of the area. Given a dbkey, you can separate its associated page number by dividing the dbkey by 2 raised to the power of the dbkey radix. For example, if the dbkey radix is 4, you would divide the dbkey value by 2**4. The resulting value is the page number of the dbkey. To separate the line number, you would multiply the page number by 2 raised to the power of the dbkey radix and subtract this value from the dbkey value. The result would be the line number of the dbkey. The following two formulas can be used to calculate the page and line numbers from a dbkey value:

Syntax

►►─ ACCept PAGE-INFO into page-info-variable FOR record-name ────────────────►

 ►─┬────────────────────┬────────────────────────────────────────────────────►◄
   └─ error-expression ─┘

Parameters

ACCEPT PAGE-INFO into page-info-variable

Specifies the variable data field to which the page info of the named record is moved.

page-info-variable

A four-byte field that may be defined either as a group field or as a fullword field (PIC S9(8) COMP). Identifies the variable data field to contain the page information for the specified record. Upon successful completion of this statement, the first two bytes of the field contain the page group number and the last two bytes contain a value that may be used for interpreting dbkeys.

FOR record-name

record-name

Specifies the record whose page information will be placed in the specified location (page-info-variable).

Note: Page information is only used if the subschema includes areas that have mixed page groups; otherwise it is ignored.

Status Codes

If autostatus is not in use, a dialog's error-status field indicates the outcome of an ACCEPT-PAGE-INFO command:

Status code

Meaning

0000

The request has been serviced successfully.

1508

The named record is not in the subschema. The program probably invoked the wrong subschema.

Example

The following example retrieves the page information for the DEPARTMENT record.

01 W-PG-INFO.
   02 W-GRP-NUM        PIC S9(4) COMP.
   02 W-DBK-FORMAT     PIC 9(4) COMP.

   ACCEPT PAGE-INFO into W-PG-INFO FOR DEPARTMENT.