Setting template preferences for HLASM

You can use the Templates preference page to define code templates that enable you to use custom code snippets.

About this task

Note: Custom code snippets (and the shortcuts that invoke them) are used in conjunction with content assist to type frequently used code constructs quickly. For example, suppose you defined a code snippet for the IF/ELSE/ENDIF macros in the list of templates with the name ifelse. The shortcut that would invoke this code snippet is ifelse. In the z Systems® LPEX Editor, you can type ifelse and then press Ctrl + Space to insert the entire code block for an if else statement into the source file.

Procedure

To set the HLASM template preferences for z Systems LPEX Editor, complete the following steps:

  1. In the navigation pane of the Preferences window, double-click the LPEX node to open the tree of available preference pages.
  2. Double-click the z Systems LPEX Editor node to open the tree of available preference pages.
  3. Double-click the HLASM Parser node to open the tree of available preference pages.
  4. Click Templates to open the Templates preference page.
  5. To create a new template, do the following actions:
    1. Click New to open the New Template dialog box.
    2. In the Name field, type a name for the new template that you want to create. For example, if you want to create a template for if else statements, type ifelse.
    3. Specify the context for the template:
      1. Select HLASM for the template to appear when you invoke content assist in assembler code.
      2. Select CICS for the template to appear when you invoke content assist in EXEC CICS statements.
    4. Select the Automatically insert check box to automatically insert the new template if it is the only available option at the caret position.
    5. In the Description field, type a description of the type of code snippet that you want to create a template for. For example, if else statement.
    6. In the Pattern field, type the pattern for your code template. This pattern can contain predefined and custom template variables. To insert a predefined template variable, click Insert Variable. From the list of predefined variables, double-click the variable that you want to include in your template pattern. You can also insert your own custom template variables into the template pattern. These must evaluate to the name of the variable itself. If you want to display the dollar symbol ($), it must be escaped using two dollar symbols or the ${dollar} variable.
    Tip: You can also use the Add as new template action to create a new template based on a selection code, refer to Creating a new template based on selected code, to enable you to use custom code snippets.
  6. To edit an existing template, do the following actions:
    1. Select the template that you want to edit, and then click Edit to open the Edit Template dialog box.
    2. Modify any information that you want to change for the selected template.
    3. Click OK to save your changes and close the dialog box.
    Tip: To revert the template back to the default values that existed before you edited the template, click Revert to Default.
  7. To remove an existing template, select the template the you want to remove and click Remove. The template is removed from the list of available templates.
    Tip: To restore a template that you removed from the list of available templates, click Restore Removed.
  8. To import a code template from another location, click Import to open the Browse dialog box and browse for the location of the template.
  9. To export an existing code template to another location, select the template that you want to export, and then click Export to open the Browse dialog box. Browse for the location that you want to export the template to.
    Tip: To export multiple templates to a single XML file, select the first template that you want to export, and then press Ctrl + click for each additional template that you want to export.
  10. Do one of the following actions:
    1. Click Restore Defaults to discard your changes and restore the default settings for this page.
    2. Click Apply to save your selections in the preference page.