The DEFINE
primary command is used to:
- Identify a macro that replaces a built-in command of the same
name
- Identify programs that are edit macros
- Assign an alias to a macro or built-in command
- Make a macro or built-in command inoperable
- Reset an inoperable macro or built-in command
- Disable a macro or built-in command
DEFINE is often used with the
BUILTIN command.
Syntax
.-CMD-.
>>-+-DEFINE-+--name--+-MACRO--+-----+-+------------------------><
'-DEF----' | '-PGM-' |
+-ALIAS--name_2--+
+-NOP------------+
+-RESET----------+
'-DISABLED-------'
- name
- The name for the command.
- MACRO CMD
- Identifies the name you are defining as a command language (CLIST
or REXX exec) macro, which is called in the same way as using the
SELECT service CMD keyword with a percent symbol (%)
preceding the command. That means that you can specify only CLISTs
or REXX EXECs.
- MACRO PGM
- Identifies the name that you are defining as a program (load module)
macro.
- ALIAS name_2
- Identifies the name you are defining as an alias of another name,
with the same characteristics. If name_2 is
already an alias, the editor replaces it with the command for which
it is an alias. Therefore, it is not possible to have an alias of
an alias.
- NOP
- Makes the name that you are defining and all of its aliases inoperable
until you reset them with RESET. Therefore, when the name or an alias
of the name is called, nothing is processed. NOP is similar to DISABLED,
except that disabled names cannot be reset by the RESET operand.
- RESET
- Resets the most recent definition of the name that you are defining
to the status in effect before that definition. For example, RESET
makes inoperable names operable again.
- DISABLED
- Disables the name you are defining and all of its aliases until
you completely exit the editor and return to the ISPF Primary Option
Menu. Therefore, when the name or an alias of the name is entered,
nothing is processed. A disabled command or macro cannot be restored
by the RESET operand. To disable RESET, use delimiters around 'RESET' to
distinguish it from the keyword.
Description
The effects of a DEFINE command
remain until you either issue DEFINE RESET or exit from the editor.
You enter the editor when you select option 2, and you do not exit
the editor until you return to the ISPF Primary Option Menu. Therefore,
if you edit several members of a partitioned data set, one DEFINE
at the beginning affects them all.
To temporarily override
the DEFINE command, use the BUILTIN command.
Stacking DEFINE commands
Except for the
DISABLED operand, the DEFINE operations are stacked. The RESET operand
unstacks them. For example:
DEFINE A alias FIND
DEFINE A alias COPY
DEFINE A alias SAVE
stacks three definitions of A. Only
the last one is effective. Here,
A would be defined
as
SAVE.
This operation:
DEFINE A RESET
removes
one command from the stack, making the previous command effective.
In the preceding example, A would now be defined as COPY.
Examples
To define the name IJKDOIT as
a CLIST or REXX macro, enter:
DEFINE IJKDOIT MACRO
To
define the name SETITUP as a program macro, enter:
DEFINE SETITUP MACRO PGM
To
define the name DOIT as an alias of the macro IJKDOIT, enter:
DEFINE DOIT ALIAS IJKDOIT
To
define the name SAVE to have no effect, enter:
DEFINE SAVE NOP
To
reset the definition of the name SAVE, enter:
DEFINE SAVE RESET
To
define the name FINDIT as disabled, enter:
DEFINE FINDIT DISABLED