How to Compile COBOL with NetExpress COBOL compiler

Compiling COBOL with CBLBLD.BAT


To compile COBOL with CBLBLD.BAT:

  1. Set up two environment variables, PS_HOME and COBROOT, on the machine from which you'll compile COBOL. (This should be either your file server or a machine that has access to your file server.) You can do this from a DOS command prompt window.
  1. Environment variable


    PS_HOME PeopleSoft home directory—that is, the drive letter and high-level PeopleSoft directory where you installed PeopleTools and the application.
    COBROOT Drive letter and root directory of the COBOL compiler.
    For example, you could enter the following at the DOS command prompt:

    set PS_HOME=C:\hr840
    set COBROOT=c:\netexpress\base

    2. Open a DOS command prompt window if you do not have one open already, and change directories to
    \Setup.

    3. Execute CBLBLD.BAT as follows
    cblbld
    where is the drive where the compile takes place, is the temp
    directory where the compile takes place

    The CBLBLD.BAT file will create the compile directory for you if it does not already exist.

    Note. Make sure to include a space between the and parameters; they are treated as two different parameters within the CBLBLD.BAT batch program. Also ensure that you have write permission to and as the compile process will take place there.

    For example, the following command will take the COBOL source from \src\cbl and do the compile process under c:\temp\compile:
    cblbld c: \temp\compile
    Make note of the information that is displayed on the screen while the process is running; it provides the locations of important files that you will need to examine.


    When compiled, the resulting optimized COBOL executables are written to the \cblbin directory as .gnt  or .int files depends upon our choice.

    .gnt =  .gnt are binary code, thus they execute very quickly but take longer time to compile. Generally, we are more concerned with modules executing quickly rather than compiling quickly, because we compile once, but we run more.
    .int = this is very quick to compile, but very slow to run.
    These COBOL copybook files are not compiled themselves.  (And since no .gnt executable modules are created for them, we never see any of these file names in the cblbin directory.)
    When we compile COBOL programs and if they fail, we check error.lis file and .lis file.   Error.lis file has name of all the COBOL programs those fail to compile while corresponding  .lis file of COBOL program has actual error message. 

    3 files of a COBOL process, for example:

    SFPGRPCL.cbl - the COBOL program itself
    SFPGRPCL.dms - Contains the script for loading the stored statements into a PeopleSoft table
    SFPGRPCL.gnt or SFPGRPCL.int - This is the actual compiled COBOL program
    .cbl gets compiled into .gnt
    .dms is run via Data Mover to store SQL statements into table – PS_SQLSTMT_TBL
    . gnt is executed and call SQL statements from PS_SQLSTMT_TBL