You can override the automatic mapout of a pageable map's first page.
By default, the first page of a pageable map is displayed as soon as the first detail occurrence of the second map page is written to scratch.
You can override this automatic mapout by specifying NOAUTODISPLAY in your STARTPAGE statement. By overriding the automatic display of the map's first page, you can add messages or modify the map before the page is displayed.
Return Code for Map Page Built
A map paging return code tells you before mapout whether a map page has been built.
The table below lists the map paging return code for map page built in COBOL, PL/I, and Assembler.
The listed code is returned as soon as a map page is built and before mapout.
Language |
Return code |
Description |
---|---|---|
COBOL and PL/I |
4680 |
|
Assembler |
X'50' |
|
How to Code a Noautosave Application
To code a pageable map application that does not automatically mapout when the first map page is built, perform the following steps:
STARTPAGE SESSION MAP01 NOAUTODISPLAY
Map Out Detail Occurrences
Perform the following steps iteratively until all data is retrieved:
MAP OUT USING MAP01 OUTPUT DATA IS YES DETAIL NEW ON DC-PAGE-READY PERFORM FIRST-PAGE THRU FIRST-PAGE-XIT. . . .
If you do not find DC-PAGE-READY, perform the IDMS-STATUS routine.
FIRST-PAGE. MAP OUT USING MAP01 OUTPUT DATA IS YES RESUME PAGE FIRST
If You Never Find DC-PAGE-READY
If, after all detail occurrences have been created, you have not received a DC-PAGE-READY status code, you should transmit the map page to the terminal screen by issuing a MAP OUT RESUME statement.
Ending the Paging Session
The next task specified in the DC RETURN NEXT TASK CODE statement should include logic to test whether the user has indicated the end of the map paging session. If so, issue an ENDPAGE SESSION statement.
Example of Suppressing Automatic Mapout
The following application does not automatically display the first page after it has been built.
OBTAIN CALC DEPARTMENT
ON DB-REC-NOT-FOUND GO TO NO-DEPT. IF DEPT-EMPLOYEE IS EMPTY GO TO NO-EMP. MOVE DEPT-ID-0410 TO WORK-DEPT-ID. STARTPAGE SESSION DCTEST01 NOWAIT BACKPAGE BROWSE NOAUTODISPLAY. PERFORM A100-GET-EMPLOYEES THRU A100-EXIT UNTIL DB-END-OF-SET. FINISH. IF LESS-THAN-A-PAGE MAP OUT USING DCTEST01 RESUME. DC RETURN NEXT TASK CODE 'DEPTEND'. A100-GET-EMPLOYEES. OBTAIN NEXT WITHIN DEPT-EMPLOYEE ON DB-END-OF-SET GO TO A100-EXIT. MOVE EMP-ID-0415 TO WORK-EMP-ID. MOVE EMP-LAST-NAME-0415 TO WORK-LAST. MOVE EMP-FIRST-NAME-0415 TO WORK-FIRST. MAP OUT USING DCTEST01 OUTPUT DATA IS YES DETAIL NEW ON ANY-STATUS NEXT SENTENCE. IF DC-PAGE-READY PERFORM A100-FIRST-PAGE THRU A100-FIRST-PAGE-EXIT ELSE PERFORM IDMS-STATUS. A100-EXIT. EXIT. A100-FIRST-PAGE. MOVE 'Y' TO FIRST-PAGE-SW. IF ALREADY-MAPPED-OUT GO TO A100-FIRST-PAGE-EXIT ELSE MOVE EMP-MESSAGE-01 TO MESSAGE-01 MAP OUT USING DCTEST01 OUTPUT DATA IS YES RESUME PAGE FIRST A100-FIRST-PAGE-EXIT. EXIT.
Copyright © 2013 CA.
All rights reserved.
|
|