COBOL compilation on Unix


COBOL compilation on Unix

To compile COBOL on UNIX:

1. Take backup of existing COBOL files (cblbin)

Note. When you bring patches up from the file server, the files need to have a lowercase cbl extension and an uppercase program name, as in PATCH.cbl.

2. Run the below to set the respective environment variables

PATH=$PATH:/app/microfocus/cobol/bin; export PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/app/microfocus/cobol/lib; export LD_LIBRARY_PATH
COBDIR=/app/microfocus/cobol; export COBDIR
PS_HOME=<Path_To_PS_HOME>; export PS_HOME

3. Change to the PS_HOME/setup directory:

cd $PS_HOME/setup

4. To compile all the COBOL source dynamically, issue the command:

./pscbl.mak

The dynamic compile creates INT, LST, and GNT files, which are copied to these locations:

*.INT -> PS_HOME/src/cbl/int
*.LST -> PS_HOME/src/cbl/lst
*.GNT -> PS_HOME/cblbin

Recompiling COBOL on UNIX:

COBOL recompilation is required in the following situations:

• Any COBOL programs change
• The supported COBOL compiler changes
• You change the version of your RDBMS
• You change your version of your operating system
• You apply a patch or a fix

Note. Remember, you must always use your file server as the source repository for your COBOL. You should download any patches and apply any customizations to the file server, and disseminate them from there.

You can compile a single COBOL program dynamically by using this command syntax:

./pscbl.mak <PROGRAM NAME WITHOUT "cbl" EXTENSION>

For example,

./pscbl.mak PTPDBTST compiles the lone file PTPDBTST.




Note. If you want to recompile all your COBOL, you can follow the procedure described earlier.
See “Compiling COBOL Programs.”

The compile should run without errors until it completes. After the script is complete, check the destination directories for the newly created files in PS_HOME/src/cbl/int, PS_HOME/src/cbl/lst, and PS_HOME/cblbin.

They should have a length greater than zero as well as a current date and time stamp.
Note. You can also use pscbl.mak PTP or pscbl.mak PTP* to compile all source files that start with PTP.

No comments:

Post a Comment