Compiling Visual COBOL on Microsoft Windows with PS_HOME and PS_APP_HOME
This section assumes that there is no separate PS_CUST_HOME directory with customized COBOL source files.
Compiling with CBLBLD.BAT with PS_HOME and PS_APP_HOME
The usage for running CBLBLD.BAT is:
cblbld <compile drive>
<compile directory> [BUILD_option] [BUILD_home]
Substitute the appropriate values as follows:
-
<compile drive>
Enter the drive letter for the drive containing the directory where the compile takes place.
-
<compile directory>
Enter the directory where the compile takes place. Be sure to include a space between <compile drive> and <compile directory>.
-
BUILD_option
The allowed values are nothing (blank), ASCII or Unicode.
BUILD_option refers to the encoding scheme of your PeopleSoft installation. This parameter is optional.
-
BUILD_home
The allowed values are nothing (blank), PS_HOME or PS_APP_HOME.
Note:
The values PS_HOME and PS_APP_HOME are case-insensitive.
BUILD_home refers to the directory from which the COBOL source files will be compiled.
This parameter is optional.
-
If the option is PS_HOME, the COBOL source files placed under %PS_HOME%\src\cbl will be copied to <compile drive>\<compile directory>, compiled, and then copied to the target directory.
-
If the option is PS_APP_HOME, the COBOL source files placed under %PS_APP_HOME%\src\cbl will be copied to <compile drive>\<compile directory>, compiled, and then copied to the target directory.
-
If the option is blank, the COBOL source files under %PS_HOME%\src\cbl and COBOL source files under %PS_APP_HOME%\src\cbl will be copied to <compile drive>\<compile directory>, compiled one after another, and then copied to the target directory.
-
To compile COBOL sources on Microsoft Windows:
-
In a command prompt, set the environment variables described in this table:
Environment Variable Purpose PS_HOME
PeopleSoft PeopleTools home directory—that is, the drive letter and high-level directory where you installed PeopleSoft PeopleTools.
COBROOT
Drive letter and root directory of the COBOL compiler.
PS_APP_HOME
PeopleSoft Application home directory—that is, the drive letter and high-level directory where you installed the PeopleSoft Application software.
For example:
set PS_HOME=C:\PTcompile set COBROOT="C:\Program Files\VisualCobol70" set PS_APP_HOME=C:\HRcompile -
Change directory to PS_HOME\setup:
cd %PS_HOME%\setup -
Run CBLBLD.BAT, using one of these methods:
-
To compile all the COBOL source files under your PeopleSoft application, that is, all PeopleSoft PeopleTools source files and all PeopleSoft Application source files, run this command:
cblbld <compile drive> <compile directory>For example:
cblbld c: \temp\PTcompile -
To compile only PeopleSoft PeopleTools COBOL source files, run this command:
cblbld <compile drive> <compile directory> PS_HOMEFor example:
cblbld c: \temp\PTcompile PS_HOME -
To compile only PeopleSoft Application COBOL source files, run this command:
cblbld <compile drive> <compile directory> PS_APP_HOMEFor example:
cblbld c: \temp\HRcompile PS_APP_HOME
-
PeopleSoft PeopleTools COBOL compiled executables will be placed under the <PS_HOME>\CBLBIN<X> directory. PeopleSoft Application COBOL compiled executables will be placed under the <PS_APP_HOME>\CBLBIN<X> directory. CBLBIN<X> will be one of the following:
-
CBLBINA if you are using ANSI encoding scheme
-
CBLBINU if you are using Unicode encoding scheme
Note:
If you chose the Unicode option while installing PeopleSoft software, the file UNICODE.CFG was created in the PS_HOME/setup directory. UNICODE.CFG automatically triggers the batch file CBL2UNI.BAT when you run CBLBLD.BAT. Another batch file, CBLRTCPY.BAT, copies DLL files that are needed for COBOL to run from the compiler directory identified by the %COBROOT% setting into the appropriate CBLBIN directory (CBLBINA or CBLBINU) when you run CBLBLD. These files can reside anywhere as long as they are in the path. You can run either of these BAT files independently from the command line (they reside in PS_HOME\setup). For CBLRTCPY.BAT you need to specify a target directory.
Compiling with CBLMAKE.BAT with PS_HOME and PS_APP_HOME
CBLBLD.BAT compiles all your COBOL source files at once, which can take a lot of time. CBLMAKE.BAT, in contrast, lets you employ one or more parameters to compile a specific COBOL source file or a selected group of COBOL source files. The procedure is slightly different depending upon whether the file that you want to compile is a PeopleSoft Application or PeopleSoft PeopleTools COBOL file. Both procedures are covered in this section.
The following table describes the various options for CBLMAKE.BAT.
| Option | Purpose |
|---|---|
|
Cblmake |
Compiles all source |
|
Cblmake all |
Compiles all source |
|
Cblmake EBCDIC |
Compiles all source files for DB2 for z/OS |
|
Cblmake PT* |
Compiles all source files that start with PT |
|
Cblmake PT* ALL |
Compiles all source files that start with PT |
|
Cblmake PT* INT |
Generates INT files for all source files that start with PT |
|
Cblmake PT* GNT |
Generates GNT files for all source files that start with PT |
|
Cblmake PT* EXE |
Generates EXE files for all source files that start with PT |
|
Cblmake PTPDBTST INT |
Generates PTPDBTST.INT file |
|
Cblmake PTPDBTST INT LIST |
Generates PTPDBTST.INT and source listing file |
|
Cblmake PTPDBTST GNT |
Generates PTPDBTST.GNT file |
|
Cblmake PTPDBTST EXE |
Generates PTPDBTST.EXE file |
To compile a PeopleSoft Application COBOL file with CBLMAKE.BAT:
-
Open a command prompt window.
-
Verify that the PS_HOME, COBROOT, and PS_APP_HOME environment variables are set, as previously defined.
See Compiling with CBLBLD.BAT with a PS_APP_HOME Setup.
-
Verify that the environment variable PS_compile_apps is set, as follows:
set PS_compile_apps=YImportant:
This variable setting is required for individual file compilation with CBLMAKE.BAT.
-
Make sure the compile directory, <compile directory>, exists, and that you have write permission to it.
This directory may already exist if you have run CBLBLD.BAT before. If it does exist, remove any files residing there—just as a safeguard. If it does not exist, you need to create it.
-
Change to the PS_HOME\setup directory.
-
If the installation is Unicode, run CBL2UNI (with no parameters).
-
Execute the following command to copy all the COBOL source files from the PS_APP_HOME directory to the compile directory:
cblsrc <source directory> <compile directory>Here <source directory> is the drive and directory where the source resides (it should be the same as PS_APP_HOME), and <compile directory> is the drive and directory to which the source files will be copied.
For example, the following command will take the COBOL source from PS_APP_HOME and copy all the necessary files to the location where the compile process will take place, c:\temp\HRcompile in this example:
cblsrc %PS_APP_HOME% c:\temp\HRcompileNote:
The compile in the next step will generate a GNT file unless the exception file, CBLINT.XX already exists (the XX represents the Product ID). CBLINT.XX contains the list of files that need to be compiled to the INT file. Make sure the intended CBLINT.XX is located under <compile directory> before executing CBLMAKE.
-
After CBLSRC completes, change directories to the compile directory, and run CBLMAKE.BAT, using the basic syntax as well as the CBLMAKE table shown earlier as your guide.
For example, to compile a file named GPPDPRUN, run this command:
cblmake GPPDPRUN -
After CBLMAKE.BAT completes, copy the EXE, GNT, or INT files to the appropriate <PS_APP_HOME>\CBLBIN<X> directory (CBLBINA for ANSI or CBLBINU for Unicode).
These examples use the ANSI encoding:
copy *.exe %PS_APP_HOME%\cblbina copy *.gnt %PS_APP_HOME%\cblbina copy *.int %PS_APP_HOME%\cblbinaNote:
You have to copy these files to the appropriate cblbin directory manually when you use CBLMAKE; they are not copied automatically, as when you use CBLBLD.
-
Verify that the compiler runtime files (*.EXE and *.DLL) are present in the <PS_APP_HOME>\CBLBIN<X> directory.
If they are not present, then you will have to run %PS_HOME%\setup\cblrtcpy.bat as follows:
cblrtcpy %PS_APP_HOME%\cblbinaSee Preparing Visual COBOL for a PeopleTools-only Upgrade for the list of files.
The procedure to compile a PeopleSoft PeopleTools COBOL file with CBLMAKE.BAT is similar, but the environment variable PS_compile_apps must not be set.
-
Open a command prompt window.
-
Verify that the PS_HOME, COBROOT, and PS_APP_HOME environment variables are set, as previously defined.
See Compiling with CBLBLD.BAT with a PS_HOME and PS_APP_HOME.
-
Verify that the environment variable PS_compile_apps is not set, as follows:
set PS_compile_apps=Important:
Unsetting this environment variable is required for individual file compilation with CBLMAKE.BAT for PeopleSoft PeopleTools files.
-
Make sure the compile directory, <compile directory>, exists, and that you have write permission to it.
This directory may already exist if you have run CBLBLD.BAT before. If it does exist, remove any files residing there—just as a safeguard. If it does not exist, you need to create it.
-
Change to the PS_HOME\setup directory.
-
If the installation is Unicode, run CBL2UNI (with no parameters).
-
Execute the following command to copy all the COBOL source files from the PS_HOME directory to the compile directory:
cblsrc <source directory> <compile directory>where <source directory> is the drive and directory where the source resides (it should be the same as PS_HOME), and <compile directory> is the drive and directory to which the source files will be copied.
For example, the following command will take the COBOL source from PS_HOME and copy all the necessary files to the location where the compile process will take place, c:\temp\PTcompile in this example:
cblsrc %PS_HOME% c:\temp\PTcompile -
After CBLSRC completes, change directories to the compile directory, and run CBLMAKE.BAT, using the basic syntax as well as the CBLMAKE table shown earlier as your guide.
For example, to compile a file named PTPDBTST, run this command:
cblmake PTPDBTST -
After CBLMAKE.BAT completes, copy the EXE, GNT, or INT files to the appropriate <PS_HOME>\CBLBIN<X> directory (CBLBINA for ANSI or CBLBINU for Unicode).
These examples use the ANSI encoding:
copy *.exe %PS_HOME%\cblbina copy *.gnt %PS_HOME%\cblbina copy *.int %PS_HOME%\cblbinaNote:
You have to copy these files to the appropriate cblbin directory manually when you use CBLMAKE; they are not copied automatically, as when you use CBLBLD.
-
Verify that the compiler runtime files (*.EXE and *.DLL) are present in the <PS_HOME>\CBLBIN<X> directory.
If they are not present, then you will have to run %PS_HOME%\setup\cblrtcpy.bat as follows:
cblrtcpy %PS_HOME%\cblbinaSee Preparing Visual COBOL for a PeopleTools-only Upgrade for the list of files.
Note:
If you plan to use cblmake.bat to compile a single (or a set) of PeopleSoft PeopleTools or PeopleSoft Application COBOL program at the same time, it would be a good idea to use two different command prompts and two different compile directories—one for PeopleSoft PeopleTools COBOL programs and the other for the PeopleSoft Application COBOL programs. This avoids setting and unsetting the PS_compile_apps environment variable.