Previous Topic: Pageable Map FormatNext Topic: How to Code a Browse Application


Conducting a Map Paging Session

A map paging session involves interaction among the user, the run-time mapping system, and your map paging application program. You should understand this interaction and the sequence of events that occurs during a map paging session before planning the logic of your application program.

Typical Map Paging Sequence

This sequence of events typically occurs during a map paging session:

  1. Your program begins the session and defines map paging parameters
  2. The program creates detail occurrences
  3. A map page is displayed on the terminal
  4. The user pages forward and backward through the pageable map
  5. The user optionally modifies map data fields
  6. The program receives control and updates the database
  7. The user ends the map paging session

The following discussion describes each step in detail.

Beginning the Paging Session

A map paging session begins when your program issues a STARTPAGE statement. Options included in this statement specify the following:

The tables below summarize flow of control in a map paging session.

Paging Type

No Data Fields Modified

Data Fields Modified**

NOWAIT

Run-time mapping displays the requested map page

Run-time mapping displays the requested map page

WAIT

Run-time mapping displays the requested map page

Control passes to the program

RETURN

Control passes to the program

Control passes to the program

* If the user presses Clear, PA1, PA2, or PA3, and that key is not associated with backward or forward paging, refer instead to "Nonpaging request" below.

** If the user presses Clear, PA1, PA2, or PA3, refer to the "No data fields modified" column.

Paging Type

No Data Fields Modified

Data Fields Modified**

NOWAIT

Control passes to the program

Run-time mapping redisplays the same map page

WAIT

Control passes to the program

Control passes to the program

RETURN

Control passes to the program

Control passes to the program

** If the user presses Clear, PA1, PA2, or PA3, refer to the "No data fields modified" column.

Creating Detail Occurrences Your program retrieves data, moves it to map data fields, and creates detail occurrences by issuing MAP OUT DETAIL commands.

Displaying the First Page

The first page is displayed on the terminal screen in one of the following ways:

Paging Forward and Backward

To specify the next map page to be displayed, the user does one of the following:

Modifying Map Fields

The user can change map data fields, including header and footer data fields, subject to restrictions specified by the STARTPAGE command (UPDATE/BROWSE) or by a previously specified MODIFY MAP command.

Updating the Database

If the user has modified any map data fields or if the paging type is RETURN, the program reads modified detail occurrences and updates the database.

A modified detail occurrence contains one or more map fields whose modified data tags (MDTs) are set on.

To retrieve a modified detail occurrence, issue a MAP IN DETAIL statement. MAP IN DETAIL can retrieve a modified detail occurrence sequentially, by the order of detail occurrences, or randomly by a key value that can be associated with an occurrence. If sequential or random retrieval cannot retrieve a modified detail occurrence, DC returns a status of 4668 (DC-NO-MORE-UPD-DETAILS).

If you need to modify the current detail occurrence (for example, to send an error message), issue a MAP OUT DETAIL CURRENT statement. This statement modifies the detail occurrence most recently referenced by a MAP IN DETAIL or MAP OUT DETAIL statement.

After processing all modified detail occurrences, write the map to the terminal screen by issuing a MAP OUT RESUME statement. If WAIT or RESUME has been specified, your program is responsible for displaying the next page specified by the user.

If you need to create additional detail occurrences, you can do so at any time by issuing further MAP OUT DETAIL statements. The new occurrences are stored at the end of the set of detail occurrences.

Ending the Paging Session

When a map paging session ends, the system deletes all the detail occurrences created during the session. To end a session, issue an ENDPAGE SESSION command.