Previous Topic Next topic Print topic


Extracting PL/I code to an include file

To help reduce duplication across your PL/I application you can extract a block of PL/I code to an include file. To extract the code, perform the following steps:

  1. In the PL/I editor, highlight the lines that you want to extract to an include file.
  2. Right-click in the PL/I editor, and then click Refactor > Extract to Include File. Alternatively, from the main menu, click Refactor > Extract to Include File.

    This opens the Extract to Include File dialog box.

  3. The Containing project field contains the current project by default. To save the code to an alternative location, type the new project name in the Containing project field. Alternatively, click Browse and navigate to a different project.
  4. In the New file name field, type an include file name with an .inc file extension.
  5. Optionally, click Preview to view the changes to be performed. In the Changes to be performed pane, you are presented with a list of the actions to be taken. By default, all actions are checked. You can uncheck actions to obtain the required results. Clicking on the actions displays the result of the actions in the Original Source and Refactored Source panes.
  6. Click OK.

    By default this extracts the highlighted source code to the specified include file and refactors the original source, leaving an %INCLUDE statement referencing the newly-created include file.

Previous Topic Next topic Print topic