Creating COBOL programs from a template

You can create new COBOL programs from a template.

Before you begin

To specify the program location on a partitioned data set or a sequential data set, you must have an existing MVS™ subproject.

About this task

For more information about modifying the program template, see Setting preferences for COBOL code templates.

For more information about COBOL templates, see Bidirectional COBOL templates.

Procedure

To create a new COBOL program from a template, complete the following steps:

  1. Click File > New > Other.
    You can also use the Ctrl+N key combination.
  2. Expand the COBOL category.
  3. Select COBOL Program.
  4. Click Next.
  5. In the New COBOL Program panel, complete the following steps:
    1. Specify the program name.
    2. Specify the author of the program.
    3. Specify the program location.
      The options are as follows:
      Partitioned Data Set
      Specify the following parameters:
      • Remote location
      • Host code page
      • Data set name
      • Member
      • Allocate PDS if new
      You can specify the data set characteristics in the next wizard panel.
      Sequential Data Set
      Specify the following parameters:
      • Remote location
      • Host code page
      • Data set name
      You can specify the data set characteristics in the next wizard panel.
      Local file
      You can specify the parent folder in the next wizard panel.
    4. You can also select the following options:
      Add comment to generated program
      When the program is generated, comment templates are added.
      Open Snippets view when finished
      The Snippets view is a clipboard-like feature that inserts chunks of text into source editors. You can use this feature for chunks of code (for example, algorithms and data definitions) that you commonly insert into any source file.
    5. Click Finish to create the program or Next to continue to the next step.
  6. Perform one of the following actions:
    • For a local file, select the parent folder in the Local COBOL Program panel.
    • For data set locations, select the data set characteristics in the Data Set Allocation panel:
      Copy characteristics from an existing data set
      Select an existing connected data set.
      Specify characteristics by usage type
      You can set the following characteristics:
      Category
      • SOURCE
      • LISTING
      • Others
      Type
      • ASM
      • C/C++
      • COBOL
      • JCL
      • PL/I
      • REXX
      Specify characteristics
      Select this option to set advanced allocation characteristics.
    1. Click Finish to create the program or Next to continue to the next step.
  7. If you specified a data set in step 5, specify the characteristics for the new PDS or sequential file in the Data Set Characteristics panel:
    • Volume Serial
    • Generic Unit
    • Space Units
    • Primary Quantity
    • Secondary Quantity
    • Directory Blocks
    • Record Format
    • Record Length
    • Block Size
    • Data Set Type
    • Expiration Date
    1. Click System Managed Storage to specify the following parameters:
      • Data Class
      • Storage Class
      • Management Class
    2. Click Finish to create the program or Next to continue to the next step.
  8. In the COBOL Program Features panel, select the features to be used in the COBOL program.
    Features provide a way to initially generate COBOL programs that perform operations similar to other programs. This initial generation is accomplished by naming and using common sections of code that go in each division.
    1. To set the features, select one or more of the following checkboxes:
      • Use BMS Maps
      • Invoke CICS commands
      • Use SQL statements
      • Handle SQL error return codes
    2. Click Finish to create the program, or select features and click Next to continue to the next step.
  9. Optional: In the COBOL Compiler Options panel, override compiler options.
  10. Click Finish to create the program.