The DEFINE
macro 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
Macro command syntax
.-CMD-.
>>-ISREDIT--DEFINE--name--+-MACRO--+-----+-+-------------------><
| '-PGM-' |
+-ALIAS--name_2--+
+-NOP------------+
+-RESET----------+
'-DISABLED-------'
- name
- The name with which you process the command.
- MACRO CMD
- Identifies the name that 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, which is called by the SELECT PGM service.
- ALIAS name2
- Identifies the name that you are defining as an alias of another
name, with the same characteristics. If name2 is
already an alias, the editor replaces it with the command it names.
Therefore, it is not possible to have an alias of an alias.
- NOP
- Makes the name you are defining and all of its aliases inoperable
until you reset them with the RESET operand. 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
- Makes the name that you are defining and all of its aliases disabled
until you end the edit session. Therefore, when the name or an alias
of the name is called, nothing is processed. A disabled command or
macro cannot be restored by RESET.
Description
The effects of the DEFINE macro
command apply only to the edit session of the member or sequential
data set being edited when the macro is run. This effect is different
from the DEFINE primary command.
To temporarily override DEFINE,
use BUILTIN.
Note: To define RESET as disabled, enclose it in
quotes ('RESET'). If you do not use quotes, the editor
interprets RESET as a keyword.
Return codes
- 0
- Normal completion
- 8
- RESET was attempted for a name not currently defined, or DEFINE
name ALIAS name2 requested and name2 is
an NOP
- 12
- DEFINE was attempted for a name not currently defined
- 20
- Severe error (unknown command)
Examples
To define the name IJKDOIT as
a CLIST or REXX macro:
ISREDIT DEFINE IJKDOIT MACRO
To
define the name SETITUP as a program macro:
ISREDIT DEFINE SETITUP MACRO PGM
To
define the name DOIT as an alias of the macro IJKDOIT:
ISREDIT DEFINE DOIT ALIAS IJKDOIT
To
define the name SAVE to have no effect:
ISREDIT DEFINE SAVE NOP
To
reset the definition of the name SAVE:
ISREDIT DEFINE SAVE RESET
To
define the name FINDIT as disabled:
ISREDIT DEFINE FINDIT DISABLED
To
create and update library statistics when data is saved, first set
the stats mode on. Then make it impossible to turn off by defining
it as disabled. Note that none of the commands that are defined as
disabled can be called while you are editing a member.
ISREDIT MACRO
ISREDIT STATS ON
ISREDIT DEFINE STATS DISABLED