How to Compile and Run an AS/400 Cobol ILE program, CBL001. (Rev. 06)

A. The AS/400 files needed
     The actual files on the AS/400 for CBL001 are as follows:

1. QSYS/AS580/QCBLSRC, member CBL001
    All of my Cobol programs are stored, as members of the
    the physical file QSYS/AS580/QCBLSRC.

    The CL command to view member names in this file is
    "WRKMBRPDM AS580/QCBLSRC"

    This means "Work with Members using the Programming
    Development Manager".

    "CL" means "an AS/400 Command Language" command.

    For full onscreen prompting, key in WRKMBRPDM and press F4.

    The Cobol source program is QSYS/AS580/QCBLSRC(CBL001).

2. QSYS/AS580/PATOUTQ
    All of my compilation output reports and execution output
    reports are stored in the output queue QSYS/AS580/PATOUTQ.

    The CL command to view this output queue is
    "WRKOUTQ AS580/PATOUTQ"

    For full onscreen prompting, key in WRKOUTQ and press F4.

    This output queue contains the compilation output report for
    source program CBL001 (see steps 4./5.), and the execution 
    output report from object program CBL001 (see steps 6./7.).

3. QSYS/AS580/CBL001
    All of my object programs (from RPG, COBOL, and CL), are
    stored as program (*PGM) files in directory QSYS/AS580.

    The object program file for source Cobol program file
    QSYS/AS580/QCBLSYS(CBL001) is QSYS/AS580/CBL001.

    This object program file is executed by the CL command
    "CALL AS580/CBL001". See steps 6./7. below.

B. The AS/400 commands needed
     The actual AS/400 instructions to compile and run CBL001 are:

4. To compile the source program QSYS/AS580/QCBLSRC(CBL001)
    Key in "WRKMBRSRC AS580/QCBLSRC" and press Enter.

    All member names in QSYS/AS580/QCBLSRC are displayed
    on the screen.

    Scroll down in the list to the source program name CBL001.

    To compile this source member, key in "14" on the left side 
    and press Enter.

    Then press function key F3 - to return to the Main menu.

    Note: After a successful compilation, the AS/400 will create
               a compilation output report in the output queue
               QSYS/AS580/PATOUTQ, and the object program file 
               QSYS/AS580/CBL001 in the directory QSYS/AS580.

5. To view the output report from the compilation from 4.
    Key in "WRKOUTQ AS580/PATOUTQ" and press Enter.

    All output queue member names in PATOUTQ are displayed
    on the screen.

    Scroll down in the list to CBL001 (the last item in the list).

    To view this compilation output report, key in "5" on the left
    side and press Enter.

    Then press function key F3 - to return to the Main menu.

6. To execute the object program QSYS/AS580/CBL001
    Key in "CALL AS580/CBL001" and press Enter.

    This will generate an execution output report, QPRINT,
    in the output queue QSYS/AS580/PATOUTQ.

7. To view the output report from the execution of 6.
    Key in "WRKOUTQ AS580/PATOUTQ" and press Enter.

    All output queue member names in PATOUTQ are displayed on the screen.

    Scroll down in the list to QPRINT of CBL001 (the last item in the list).

    To view this output report, key in "5" on the left side and press Enter.

    Then press function key F3 - to return to the Main menu.

8. To sign off the AS/400, key in "90" and press Enter.

Isn't using the AS/400 fun? :)