Compliling
Compiling COBOL locally can save you considerable time during the development/troubleshooting stage.
The steps for compiling COBOL locally are:
- Install Microfocus NetExpress
- Configure the
%COBROOT%
system variable to point to the Microfocus NetExpress compiler path - Copy the batch files for compiling COBOLs from
%PS_HOME%\src\cbl\win32
to yourC:\WINDOWS
directory - Copy all COBOLs to a local directory, for example
C:\COBOL
- Compile COBOLs using the
CBLMAKE.BAT
batch script
When you install Microfocus, put it in a directory with no spaces. I like to use something like C:\NetExpress
rather than the default directory. This is just a preference, I'm not sure if it causes any issues.
You will need create a system environment variable called COBROOT
. This points to the Base directory of your Microfocus NetExpress installation. For example, C:\NetExpress\Base
.
Browse to your PeopleSoft File Server and copy the following files from %PS_HOME%\src\cbl\win32
to your C:\WINDOWS
directory:
ASCII.DIR
CBLRULE.BAT
CBLMAKE.BAT
CBLCRINT.BAT
CBLCD.BAT
EBCDIC.DIR
Copying them to your WINDOWS
directory lets you run them from anywhere as they are automatically in the system path.
Copy all the COBOLs from your PeopleSoft file server to a local directory (C:\COBOL
).
Command prompt to the local directory and attempt to compile a program (e.g. the delivered PTPDBTST
program) by issuing the command (note that you drop the .cbl
extension):
cblmake PTPDBTST
Hopefully it compiles for you. If not, you may have forgot to set the COBROOT
environment variable. Make sure you set this first.
To build all cobols, run the following command (in Windows) from %PS_HOME%\setup
:
cblbld.bat C: \temp
This will copy source COBOLs from %PS_HOME%\src\cbl\base
to C:\Temp
(or whatever drive and directory you specify), compile them and put them in a directory named %PS_HOME%\CBLBIN(A/E/U)
where A=Ansi
, E=EBCDIC
and U=Unicode
.
After the build, the build log will be displayed. You can also view the build log by opening the file CBLBLD.LOG
which will be located in the compile directory (e.g. C:\Temp
).
If you find the following throughout your log file:
...
Creating error listing (COBOL1.LIS)
Creating error listing (COBOL2.LIS)
Creating error listing (COBOL3.LIS)
...
It may mean your Microfocus NetExpress license has expired. Check by starting Microfocus NetExpress. COBOLs will not compile on Windows systems when the license has expired.
If compiling gives the following error:
Application Program Failed
Action Type : SQL CONNEC
In Pgm Section : SQLRT:GG100 SQL-CONNECT
With Return Code: 9989
Error Message : SQLRT: Operator ID not allowed to submit COBOL from client
This can be caused by having %PS_HOME%\bin\client\winx86\
in your system path. Remove this location from your system path and try again.
2 Comments
Is there a page like this one for compiling with Visual COBOL? We have just installed Visual Studio 2017, and I can't find any instructions for compiling PeopleSoft COBOLs with it.
do you have the steps for doing it for Linux/Unix? I would assume they are about the same however it would be a good review when having to do this.
Also any tricks for recompiling a specific cobol?