Linear procedures

Linear procedures can contain comment lines, blank lines, substitution variables, any QMF command, and RUN commands that run other procedures or queries.

When a variable is set using the SET GLOBAL command in a linear procedure, the value is unavailable to commands in that same procedure because all substitution variables in a linear procedure must be resolved before the procedure is run. You are prompted for any unresolved variables in your procedure. However, the variable is available to any queries or procedures called by the procedure in which it was set.
Substitution variables
QMF scans the entire procedure for substitution variables, and the values are resolved before the procedure is run.
Global variables
Access global variable values in linear procedures by using substitution variables.

After the global variables are set, if you need to reset them you must code a RESET GLOBAL statement at the end of your procedure. Otherwise, the previous set of substitution values will continue to be used.

Return codes and procedure termination
Success or failure of a command is indicated by a return code. If a command is not successful, the procedure ends and the incorrect command is displayed at the top of the procedure area.
Continuation lines
Indicated by a plus sign (+) in column one of the continued line. Command keywords, substitution variables, and comments cannot span lines.
Comments are prefaced by two dashes, as follows: