PS_APP_PATCH_HOME and Custom COBOL Compile

cobol peopletools Apr 18, 2016

Dan Iverson

The delivered COBOL compile scripts support compiling each HOME individually, but we can’t combine homes into a single CBLBINA folder. Additionally, with PeopleTools 8.55 dropping support for PS_CUST_APP_HOME, we are using a custom PS_APP_PATCH_HOME folder in the layer between PS_CUST_HOME and PS_APP_HOME.

To learn about PS_APP_PATCH_HOME, check out this video overview of the custom home we built for patching.

PS_APP_PATCH_HOME and Custom COBOL Compile

CBLBINA Directories Before

Before the change, we compiled each decoupled home separately we had 3 CBLBINA directories.

+-------------+  +-------------+  +--------------+
|             |  |             |  |              |
|   PS_HOME   |  | PS_APP_HOME |  | PS_CUST_HOME |
|             |  |             |  |              |
+-------------+  +-------------+  +--------------+

CBLBINA Directories After

After the change, we have 2 CBLBINA directories. One for the PeopleTools COBOL programs, and one for the application programs. The application COBOL programs are stored in our PS_CUST_HOME\CBLBINA folder.

+-------------+  +-------------------+
|             |  | PS_APP_HOME       |
|   PS_HOME   |  | PS_APP_PATCH_HOME |
|             |  | PS_CUST_HOME      |
+-------------+  +-------------------+

Modified Build Script

We use a batch helper script to configure the environment and call our new cblbld_all.bat script. The script CompileHR92DEVCobols_APP_PATCH_CUST.bat script will configure the environment variables for HR92DEV. Then it calls cblbld_all.bat e: \psoft\temp\compile ASCII to compile the COBOL source files.

This command cblbld_all.bat e: \psoft\temp\compile ASCII will trigger:

  1. File copy from PS_APP_HOME\src\cbl\base
  2. File copy from PS_APP_PATCH_HOME\src\cbl\base
  3. File copy from PS_CUST_HOME\src\cbl\base
  4. Compile the combined source files
  5. Copy compiled COBOLs to PS_CUST_HOME\CBLBINA

The delivered cblbld_mf.bat file was copied to e:\psoft\tools and renamed to cblbld_all.bat. The script was modified to support the changes above. We also merged in code from the cblsrc.bat script that copied the source files. The cblbld_all.bat script does all the steps for our compilation process.

This is the high-level code for the script. The actual script is longer, contains extra code from the delivered script, like folder/permissions checks, and has Oracle’s copyright. So here are the changes we made to cblbld_mf.bat.

rem ------------------------------------------------
set COMPILEDRIVE=%1
set COMPILEDIR=%2
set CBLSRCDR=%PS_HOME%\SRC\CBL
set CBLBINDR=%PS_CUST_HOME%\CBLBINA
set PS_purge_CBLBLDLOG = Y
set CBLBLDLOG=%COMPILEDRIVE%%COMPILEDIR%\CBLBLD.LOG

rem ------------------------------------------------
rem Delete the contents of the compile directory.
if defined PS_purge_CBLBLDLOG (
    echo Y | del %COMPILEDRIVE%%COMPILEDIR% > NUL
)

rem ------------------------------------------------
rem Copy Source Files
call %PS_HOME%\SETUP\CBLRTCPY %CBLBINDR% >> %CBLBLDLOG% 2>&1
copy %PS_HOME%\src\cbl\base\PTC*.cbl %COMPILEDRIVE%%COMPILEDIR%
copy %PS_HOME%\src\cbl\win32\* %COMPILEDRIVE%%COMPILEDIR%
copy %PS_APP_HOME%\src\cbl\base\*.cfg %COMPILEDRIVE%%COMPILEDIR%
copy %PS_APP_HOME%\src\cbl\base\*.cbl %COMPILEDRIVE%%COMPILEDIR%
copy %PS_APP_PATCH_HOME%\src\cbl\base\*.cfg %COMPILEDRIVE%%COMPILEDIR%
copy %PS_APP_PATCH_HOME%\src\cbl\base\*.cbl %COMPILEDRIVE%%COMPILEDIR%
copy %PS_CUST_HOME%\src\cbl\base\*.cfg %COMPILEDRIVE%%COMPILEDIR%
copy %PS_CUST_HOME%\src\cbl\base\*.cbl %COMPILEDRIVE%%COMPILEDIR%

rem ------------------------------------------------
rem Compile COBOL Programs
call CBLMAKE ALL >> %CBLBLDLOG%  2>&1

rem ------------------------------------------------
rem Deploy
IF EXIST %CBLBINDR%\*.EXE echo Y | del %CBLBINDR%\*.EXE
IF EXIST %CBLBINDR%\*.GNT echo Y | del %CBLBINDR%\*.GNT
IF EXIST %CBLBINDR%\*.INT echo Y | del %CBLBINDR%\*.INT

call %PS_HOME%\SETUP\CBLBIN %COMPILEDRIVE%%COMPILEDIR% %CBLBINDR% >> %CBLBLDLOG%


Note: This was originally posted by Dan Iverson and has been transferred from a previous platform. There may be missing comments, style issues, and possibly broken links. If you have questions or comments, please contact [email protected].