Application Program Files

Application programs have several segments. Some segments are specific to the program (for example, the procedural code and the working storage data definitions), and some are global to the application system to which the program belongs (for example, database input/output routines).

Each program segment is stored in a separate file and is processed by standard input/output procedures. (A program segment file is often called a library module.)

Program-Specific Files

All application programs have the files described in the following table.

File Description
Program shell (.cbl) The complete program built by the Build Shell (bldsh) utility.
Procedure division (PD) The procedural code unique to the program. The procedural code is a subset of the complete procedure division of a 4GL program. This subset contains only the paragraphs necessary to edit and process the form; the Environment software handles all other routines.
Working storage data definition (WS) The working storage data definitions unique to the program.
Form (screen) definition (.scr) The 4GL definition of the form or forms associated with the program. The compilation process uses this file to generate the form definition library.
Form definition library (SD) This file is generated during the compilation process for inclusion in the program shell. The compilation process normally deletes this file at the end of compilation.

In addition to the files listed in the previous table, report programs also have the files listed in the following table.

File Description
Report definition (.rpt) The 4GL definition of the report or reports associated with the program. The compilation process uses this file to generate the report definition library.
Report definition library (.rd) This file is generated during the compilation process for inclusion in the program shell. The compilation process normally deletes this file at the end of compilation.

Files You Can Modify

You might need to modify some of the program-specific files when you write procedural code. The following application files require you to make some changes:

  • Procedure division (PD)

  • Working storage definition (WS)

  • Application library

  • Form definition (.scr)

  • Report definition (.rpt)

Environment software handles all other functions such as form editing, form transfers, and report formatting.

All programming is done either as small segments or as parameters passed to other programs. This eliminates detailed (low-level) programming for input or output.

Generated Files

You do not need to modify all of the program-specific files when you write procedural code. The following files are generated files that you do not modify:

  • Program shell (.cbl)

  • Form definition library (SD)

  • Report definition library (.rd)

All three files generally exist for the compilation process only. If you choose to keep one or more of these generated files, do not change any of them manually.

File Name Format

All application files have specific names, which must be known to the dictionary defined in %LAWDIR%\productline.

The following table lists the files that are specific to a program. Each file must use the file name format shown or the program does not compile.

File File name format
Program shell (.cbl) %LAWDIR%\productline\systemcodesrc\\programcode.cbl
Procedure division (PD) %LAWDIR%\productline\systemcodesrc\\programcodePD
Working storage data definition (WS) %LAWDIR%\productline\systemcodesrc\\programcodeWS
Form (screen) definition (.scr) %LAWDIR%\productline\systemcodesrc\\programcode.scr
Form definition library (SD) %LAWDIR%\productline\sdlib\programcodeSD
Report definition (.rpt) %LAWDIR%\productline\systemcodesrc\\programcode.rpt
Report definition library (.rd) %LAWDIR%\productline\rdlib\programcode.rd

For example, the name and location for the procedure division (PD) file for the GL20 program in the %LAWDIR% directory \law and in the dev product line is baseDirectory\law\dev\glsrc\GL20PD.