       1000-GET-EMPLOYEE.
           MOVE ZERO TO RECORD-COUNT
           PERFORM 2000-GET-NEXT-EMPLOYEE THRU 2000-EXIT
              UNTIL DB-END-OF-SET.
       1000-EXIT. EXIT.

       2000-GET-NEXT-EMPLOYEE.
           IF RECORD-COUNT = 0
              OBTAIN FIRST EMPLOYEE-REC WITHIN EMPLOYEE-AREA
           ELSE
              OBTAIN NEXT EMPLOYEE-REC WITHIN EMPLOYEE-AREA
           END-IF
           IF DB-END-OF-SET
              GO TO 2000-EXIT
           END-IF
           PERFORM IDMS-STATUS
           PERFORM 3000-GET-NEXT-JOBHIST THRU 3000-EXIT
              UNTIL DB-ANY-ERROR.
      *SET CURRENCY BACK TO LAST EMPLOYEE-REC
      *THE “FIND” IS USED INSTEAD OF THE “OBTAIN” BECAUSE THE PROGRAM
      *IS NO LONGER INTERESTED IN THE DATA FROM THAT RECORD.
           FIND CURRENT EMPLOYEE-REC
           PERFORM IDMS-STATUS
           .
       2000-EXIT. EXIT.

       3000-GET-NEXT-JOBHIST.
           OBTAIN NEXT JOBHIST WITHIN EMP-JOBHIST
           IF NOT DB-END-OF-SET
               PERFORM 4000-WRITE-OUT-DATA THRU 4000-EXIT
           END-IF
           .
       3000-EXIT. EXIT.
