Coding Example

The following is an example of a batch job file member that contains a job input stream:
      //BCHJOB   JOB(ADD021) JOBD(QUSER/ACCTEST)
      CALL       PGM(QSYS/ACCPT1X)
      123456789012345
      //ENDBCHJOB
The following is an example of a COBOL program that uses a Format 1 ACCEPT statement to read the job input stream:
        IDENTIFICATION DIVISION.
        PROGRAM-ID. ACCPT1X.
        ENVIRONMENT DIVISION.
        CONFIGURATION SECTION.
        SOURCE-COMPUTER. IBM-ISERIES.
        OBJECT-COMPUTER. IBM-ISERIES.
        DATA DIVISION.
        WORKING-STORAGE SECTION.
        77  TRANS-DATA   PIC X(15).
        PROCEDURE DIVISION.
        BEGIN.
            ACCEPT TRANS-DATA.
            DISPLAY TRANS-DATA.
            STOP RUN.

When the batch job file member is used to call ACCPT1X, the ACCEPT statement reads the batch job file member from the line that immediately follows the CALL command. This causes "123456789012345" to be accepted into TRANS-DATA.