Opening expanded source files

Use the Show Expanded Source menu item to open a COBOL or PL/I file in read-only mode with copybooks and include files expanded.

Supported Editors:
  • COBOL Editor
  • PL/I Editor
  • z Systems LPEX Editor

Before you begin

  1. Associate a property group with the file. Specify these property group options:
    • In the SYSLIB field of the property group, specify a search path for copybooks and include files.
    • On the Local Preprocessors page, select -INC/++INCLUDE Preprocessor.
    • In the Preprocessor arguments field, specify CMT(ON).
  2. If you previously ran the local include preprocessor against the source file, open the file in an editor and select Source > Preprocessor Statements > Clear Identifications (COBOL and PL/I Editors) or Preprocessor Statements > Clear Identifications (z Systems LPEX Editor).

About this task

The Show Expanded Source action uses the local include preprocessor that is included with the product to open a source file with copybooks and include files expanded. The preprocessor runs in the background so that you can continue to use the product while the Show Expanded Source action completes. The expanded file is opened in the same editor from which you requested the action. If, for example, the file was open in the COBOL Editor when you requested the Show Expanded Source action, then the expanded file is also opened in read-only mode in the COBOL Editor. While the expanded file is open, you can do any actions that are valid for files open in read-only mode.

Limitation: The local include preprocessor is not supported on Linux or MacOS clients.

Procedure

  1. Open a COBOL or PL/I source file.
  2. From the menu, select Source > Show Expanded Source or press Ctrl+Shift+E.

Results

The expanded source file is opened in read-only mode. Comments are added to the file to mark the beginning with commented out COPY or INCLUDE statement followed by the library location where the dependency was resolved from and then the actual copybooks or include file content.
See the following example for COBOL:
* COPY ABC.

* Copybook Location:
* MYSYSTEM\HLQ\HLQ.A001.COPYLIB1.COPYLIB\MYCOPY1.cpy

01  XYZ     PIC X
01  FIRST   PIC 9
See the following example for PL/I:
/*
  %INCLUDE MYINC1;
  * Include Location:
  * MYSYSTEM\HLQ\HLQ.A001.PLILIB1.INCLUDE\MYINC1.inc
*/

    dcl XMYINC1 CHAR(20) INIT('INSIDE MYINC1');
Note: The Show Expanded Source action works similarly for local files.