Execute ISPF Edit Macro

A tool of type "Execute ISPF Edit Macro" should be defined in an action which itself is defined as a global action with an ISA_Editor_Action relation so that it is added to the editor’s context menu. In the ISA_Editor_action relation, you can define the file suffixes for which the editor action should apply.

A tool of type "Execute ISPF Edit Macro" copies the current content from the active editor to a temporary data set on the remote system and then applies a user defined ISPF edit macro to this remote data set. Afterwards the potentially-changed content of the remote file is transferred back to the client and replaces the current content of the editor from where the content was originally taken.

The current cursor position is exchanged between the client and the remote system. That means that the current cursor position in the active editor is read at the beginning of the tool and sent to the remote system. On the remote system the cursor will then be placed in that position in the temporary data set right before the execution of the ISPF edit macro starts. After the ISPF edit macro has finished, the cursor position is read out of the remote editor and pushed back to the client machine, which then puts the cursor in that same position in the client editor after its content is replaced.

Tool Attributes:

Attribute Type Description
Edit Scenario [M] Selection Specifies in which scenario the edit macro tool is executed. This can be either in a local or remote edit scenario.

A remote edit scenario means that the content of the editor is directly retrieved from an MVS resource. The temporary resource is created in the remote edit scenario as follows. The temporary data set has the same data set attributes as the original file but is allocated with less space. If the editor contains a member of a partitioned data set, the temporary file is a partitioned data set with a member that has the same name as the member that is being edited. The name of the remote temporary data set is derived from the name of the parameter file data set. See Master configuration syntax section in the Local Master Configuration topic for more information.

 A local edit scenario means that the content of the editor is retrieved from a local file. See the attribute ‘Target File Type’ for more information

Valid values:

  • Remote Edit (Default)
  • Local Edit
Target File Type [O] Selection This attribute is only required if the tool is executed in a local edit scenario.

This attributes defines how the required temporary MVS resource is created.

If the Target File Type is set to Temporary Resource, either a SEQ-dataset or a partitioned data set member will be created at the defined location, with physical name defined in the file descriptor and static attribute values. If the target already exists the content of the resource is overridden.

If the Target File Type is set to Template Resource, the data set attribute values of the template resource are taken to create the new temporary resource. If the template resource is a SEQ-dataset, the same data set attributes are used as the original file, but the data set is allocated with less space. If the template is a member of a partitioned data set, the temporary file is a partitioned data set with a member that has the same name as the template member. The name of the remote temporary data set is derived from the name of the parameter file data set. See Master Configuration for more information.

Valid values:

  • Temporary Resource (Default)
  • Template Resource

Parameters:

Parameter No I/O Type Description
1 [M] I String Macro Name:

Name of the ISPF Edit Macro. Maximum length 8 characters.

2 [O] I File Target Resource:

The Target MVS resource. This input parameter is only required in case of a local edit scenario. The edit macro runs against a temporary MVS resource which is created based on this input parameter. See the attribute Target File Type for more information.

3 [O] I String Macro parameter:

Every parameter following the macro name is interpreted as a parameter for the ISPF macro and all parameters are concatenated in the same sequence as they appear in the model with a space between them. That concatenation is then handed over to the ISPF macro at start up time.