To write a pageable map application that allows the user to display data but not update it, perform the following steps:
Ending the Browse Session
If, after all detail occurrences have been created, the first-page switch is not set, you should transmit the map page to the terminal screen by issuing a MAP OUT RESUME statement.
The next task specified in the DC RETURN NEXT TASK CODE statement should include logic that tests to see if the user has indicated the end of the map paging session. If so, issue an ENDPAGE SESSION statement.
Example of a Browse Application
The program excerpt below shows a pageable map application in which run-time mapping handles all paging requests (paging type of NOWAIT) and the operator cannot make updates (paging mode of BROWSE).
After acquiring the data passed from a previous task and establishing that database records are present, this program issues MAP OUT DETAIL statements iteratively until all detail occurrences are written. DEPTEND, which is specified as the next task, ends the paging session with the ENDPAGE command and performs processing based on the control key pressed.
DATA DIVISION 01 FIRST-PAGE-SW PIC X VALUE 'N'. 88 LESS-THAN-A-PAGE VALUE 'N'. 01 MAP-WORK-REC. 05 WORK-FIRST PIC X(10). 05 WORK-LAST PIC X(15). 05 WORK-EMP-ID PIC X(4). LINKAGE SECTION. 01 PASS-DEPT-INFO. 05 PASS-DEPT-ID PIC 9(4). 05 PASS-DEPT-INFO-END PIC X. PROCEDURE DIVISION. BIND MAP DCTEST01. BIND MAP DCTEST01 RECORD MAP-WORK-REC. *** ACQUIRE DEPT-ID FROM ERROR CHECKING PROGRAM *** GET STORAGE FOR PASS-DEPT-INFO TO PASS-DEPT-INFO-END WAIT SHORT USER STGID 'RKNS'. * MOVE PASS-DEPT-ID TO DEPT-ID-0410. FREE STORAGE STGID 'RKNS'. * COPY IDMS SUBSCHEMA-BINDS. READY USAGE-MODE RETRIEVAL. * OBTAIN CALC DEPARTMENT ON DB-REC-NOT-FOUND GO TO NO-DEPT-ERR. IF DEPT-EMPLOYEE IS EMPTY GO TO NO-EMP-ERR. *** BEGIN MAP PAGING SESSION *** STARTPAGE SESSION DCTEST01 NOWAIT BACKPAGE BROWSE. PERFORM A100-GET-EMPLOYEES THRU A100-EXIT UNTIL DB-END-OF-SET. FINISH. *** IF FIRST PAGE NOT YET SENT, MAP OUT RESUME *** IF LESS-THAN-A-PAGE MAP OUT USING DCTEST01 RESUME. *** NEXT TASK ENDS PAGING SESSION *** 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-FIRST-NAME-0415 TO WORK-FIRST. MOVE EMP-LAST-NAME-0415 TO WORK-LAST. MOVE EMP-ID-0415 TO WORK-EMP-ID. *** MAP OUT CURRENT DETAIL, CHECK FOR ERROR-STATUS OF 4676 *** MAP OUT USING DCTEST01 DETAIL NEW ON DC-FIRST-PAGE-SENT MOVE 'Y' TO FIRST-PAGE-SW. A100-EXIT. EXIT. . . . *** FURTHER PROCESSING, INCLUDING ERROR ROUTINES ***
Copyright © 2013 CA.
All rights reserved.
|
|