       IDENTIFICATION DIVISION.
       PROGRAM-ID. IO-SENSE.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  J                      PIC 9(4).
       LINKAGE SECTION.
       01  I                      OCCURS 1000 TIMES PIC S9(5)V9(5).

       PROCEDURE DIVISION USING I.
       ENTRY "IO-SENSE" USING I.
           PERFORM VARYING J FROM 1 BY 1 UNTIL J > 1000
               COMPUTE I(J) ROUNDED = FUNCTION RANDOM
           END-PERFORM
           GOBACK.
       END PROGRAM IO-SENSE.

       IDENTIFICATION DIVISION.
       PROGRAM-ID. IO-OUTPUT.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  FIELDPRINT             PIC S9(5)V9(5).
       01  J                      PIC 9(4).
       LINKAGE SECTION.
       01  I                      OCCURS 1000 TIMES PIC S9(5)V9(5).
       01  STEP                   PIC 9(7).

       PROCEDURE DIVISION USING I STEP.
       ENTRY "IO-OUTPUT" USING I STEP.
           CALL 'RWD-FIELDPRINT' USING I FIELDPRINT
           DISPLAY 'Step: ' STEP ' Fieldprint: ' FIELDPRINT
           GOBACK.
       END PROGRAM IO-OUTPUT.
