Program macros have special characteristics that you should consider
before coding:
- Variables are not self-defining in program macros, as they are
in CLISTs and REXX EXECs. The VDEFINE, VCOPY, and VREPLACE dialog
services must be called to identify variables looked at or set by
the program.
- If you write a REXX exec or a program macro that accepts parameter
input, the macro must be aware that the input may be in lowercase.
Variable values are automatically converted to uppercase by the CLIST
processor.
- Program macros are not implicitly defined, while CLIST and REXX
macros are. When you use a command name that is not a built-in or
previously defined primary command, the editor searches the SYSUEXEC,
SYSUPROC, ALTLIB, SYSEXEC, and SYSPROC concatenations (for CLISTs
and REXX EXECs) for a member with the same name. If it exists, it
is assumed to be a macro.
No automatic search is done for program
macros. Therefore, there are two ways to tell the editor to run a
macro as a program macro. You can precede the name with an exclamation
point (!) if it is less than 8 characters, or you
can use the DEFINE command to define the name as a program macro.
Program macros are treated as ISPF dialogs, and must be made available
as load modules in either the ISPLLIB, STEPLIB, or LINKLST library.
- Program macros can run without being verified as macros; the MACRO
statement can follow calls to dialog services.
- The editor scans edit statements within program macros to do variable
substitution similar to the CLIST processor. Only one level of substitution
is done. This is the default; use the SCAN assignment statement to
prevent it.