Guidelines for writing procedures with logic

When you write procedures with logic, keep some specific guidelines in mind.

  • A procedure with logic can contain QMF commands, REXX logic statements, and comment lines.
  • Use the complete names for commands, options, and values, rather than the abbreviated names.
  • Do not specify a command of more than 2,000 characters (or the equivalent in DBCS). QMF stops running a procedure when it finds a command of over 2,000 characters.
  • You can include comments on the same line as a command, but place them after the command.
  • If a command spans more than one line, type a comma as a continuation character at the end of the first line. For example:

    Because this statement is a QMF command that is split into two lines, both lines are enclosed in quotes. The continuation character is placed at the end of the first line, outside the quotes.

    You cannot use a continuation character in a comment line, command keyword, or substitution variable name. You can use a continuation character in a substitution variable value if you enclose the value in single quotation marks.

    You can type comments between continuation lines.

    If the object name is long enough to continue it on multiple lines, follow the REXX syntax rules for continuation and concatenation. Enclose each part of the object name in single quotation marks and use the concatenation symbol (||) at the beginning of each new line. The following figure shows an example of an object name that spans two lines in a procedure with logic:
    Figure 1. Spanning an object name across multiple lines in a procedure with logic
     /* REXX PROC */ 

When you save a procedure, the procedure name might not be fully displayed at the top of the PROC panel if the authorization ID is longer than eight characters or the object name is longer than 18 characters. Enter the SHOW NAME command from the command line to display a pop-up screen that contains the complete object name.