Building a Shell

This section provides instructions on building a shell separately from compiling using the Build Shell utility (bldsh). The Lawson compile tools, described in Compiling from Program Definition build a shell from the generated code.

Because the individual program segments cannot be compiled separately, the Lawson precompiler creates a program shell (.cbl) before it compiles a program. The program shell contains all the individual segments required to compile a program. The precompiler creates the program shell each time it compiles a program to ensure that any changes made in any program segment are reflected in the shell.

Although the precompiler creates the shell before it compiles the program, you can build a shell without compiling the program.

To create the program shell (.cbl), the precompiler analyzes the procedural code (PD) to determine which library modules and database routines it references. It includes these routines and any referenced program files in the shell. All program shells contain:

  • Required DIVISION and SECTION statements,

  • Working storage for the transaction code, database, and form routines,

  • Database routines,

  • Form routines, and

  • Files specific to the program.

The precompiler copies some routines into the program shell and generates code for other routines.

To build a shell

  1. From the Environment Utilities or Application Development Workbench menu, choose Programmer Utilities.
  2. From the Programmer Utilities menu, choose Compile Tools.
  3. From the Compile Tools menu, choose Build Shell.

    The Build Shell window appears.

  4. In the following fields, type or select the following information.
    Field Description
    Product Line The product line of the program for which you want to build a shell.
    System Code The system code of the program for which you want to build a shell.
    Program Code The program code for which you want to build a shell.
    Input/Output Options Optional. A command to display the output or redirect it to a file.
  5. Press Enter.

    Command syntax: bldsh [-Fu123] productline systemcode programcode

    Options F, 1, 2, and 3 are used only at Lawson. Type bldsh at the command line for a description of these options.