Menu Manager Customised for USS Objects



[pic]

This paper describes the steps required to customise Menu Manager to invoke a USS script; it complements an earlier paper that described how to customise Menu Manager to invoke a TSO command. Such a Menu Manager can be invoked from the context menu for the associated entry.

Note: The shown screenshots were made using RDz 7.5.1; the displays may differ for other RDz versions.

1. Create a new Menu Manager action

Preferences -> Menu Manager -> Actions and Menus

File Selection: this specifies where the action and menu definition will be stored.

Either accept the current selection or click [New…] to create a new file.

[pic]

Activate the appropriate resource type radio-button to specify for which resource type (project/subproject or file) the action and menu definition should apply. In our case: File.

Click [Browse…] to navigate to the required directory.

[pic]

Navigate to the required directory and enter the new name of the file where the definition is to be stored. The directory can be either remote or local.

The file extension should be XML. Although the file name can be chosen freely, the name used in this example is the standard name (uss_base_file_actions.xml).

[pic]

Click [OK] to create the file.

[pic]

Click [Finish] to use the specified name.

Click [New Local/Remote Action…] to define a new local/remote action.

[pic]

2. Specify a name for the new Menu Manager action

The name specified here is that what appears later in the context menu.

[pic]

3. Specify the associated file type

Specify for which file type(s) the action is to be associated. The action can only be invoked from the context menu for entries with these file types.

In this example, only *.c is selected as file type.

[pic]

3.1 Accept the chosen file types

[pic]

The “Chosen File Types” pane contains the selected file types.

Clock [Next >] to accept the selection.

4. Specify the run options

In this case, enable the following boxes:

• Show on generic menu

• Run action in foreground

• Remote Command

[pic]

Click [Script Configuration…]

5. Specify the script (and parameters) to be invoked

Four different scripts can be invoked:

• Header – the script invoked before the first object (program) is processed

• Command Header – the script invoked to perform initial processing for each object

• Command Footer – the script invoked to perform final processing for each object

• Footer – the script invoked after the last object has been processed

Such a hierarchy of commands can be required when a subproject contains more than one program. For example, the Command Header/Footer scripts generate a series of object files that the Footer script converts into an executable file.

For simplicity, it is assumed here that a subproject contains just a single program file. As such, it does not matter in this case which of the scripts is invoked.

The script(s) to be invoked must be configured (-> Script Configuration… ).

Enable the box(es) of the script(s) to be configured.

The Filename column specifies the name of the script.

The Export Variables specifies any parameters to be passed to the script.

5.1 Script configuration

As example, the invoked script compiles a MetalC program.

The following settings must be made in this case:

Filename:

metalc.cmd

The “Filename” is the name of the command that will be invoked.

Export variables:

&RN &X &USR_SYSLMOD& &USR_MODNAME&

The “Export variables” are the variables passed as arguments to the invoked command.

&RN and &X are predefined substitution variables (see Appendix 2):

&RN = full remote path of the file

&X = the file name without the extension

&USR_SYSLMOD& and &USR_MODNAME& are user-defined variables:

&USR_SYSLMOD& = dataset name of the z/OS load library

&USR_MODNAME& = load module name

Predefined substitution variables can be selected from the popup list displayed when the [Variables…] button is clicked. User-defined variables must be entered directly in the Export Variables field.

Note: User-defined variables must be prefixed with USR_ and written within ampersands (&s).

Depending on the variable type, the associated value will be set automatically (predefined substitution variable) or must be entered in the popup displayed when the action is invoked (user-defined variable).

[pic]

5.2 Selecting substitution variables

Clicking the [Variables…] button displays a selection list of the standard substitution variables (see Appendix 2 for a complete list of standard substitution variables):

Double-click on the selected variable, in this case &RN, to add it to the Export Variables list (the variable name can be entered directly in the “Export Variables” field.

Notes:

1. Only a single variable can be selected from the Substitution Variables display. It must be reinvoked if more than one substitution variable is required.

2. Although offered for selection, the &PROMPT variables are not currently honoured.

[pic]

5.3 Completed customized action

Our action (MetalC) has now been defined and appears in the Actions list.

[pic]

Click [OK] to exit the dialog.

6. Script

The invoked script is passed the arguments specified as exported variables in the script configuration.

The script accesses the associated arguments with the name $BBS_varname (where is the name of the associated export variable, without the ampersands).

For example

$BBS_RN refers to the &RN substation variable, namely full remote path of the file

$BBS_USR_SYSLMOD refers to the &USR_SYSLMOD& user variable.

In the shown example, the metalc.cmd script performs the MetalC compilation:

xlc -S -v -qmetal $BBS_RN

as -v $BBS_X.s

ld -v -o "//'$BBS_USR_SYSLMOD($BBS_USR_MODNAME)'" $BBS_X.o

The specified script must be located in the path specified by the TPFSHARE environment variable (see Appendix 3).

For simplicity, the MetalC compilation script receives only the SYSLMOD dataset name and the member name. It could be extended to receive compilation options, etc.

6.1 Other script variants

Another variant involves specifying the command and parameters in the Command field and activating the Remote Command checkbox to specify that a UNIX script is to be executed. This variant is discussed briefly in Appendix 1.

[pic]

7. Invocation of a customized action

7.1 Specify properties

At the file level, click Properties to display the Properties window in which the user parameter values can be specified.

[pic]

Click User Variables and [Add…]

[pic]

Enter the values for the two user variables: USR_MODNAME and USR_SYSLMOD.

[pic]

Click [OK]

[pic]

Click [Apply] to apply the values.

Click [OK] to exit the window.

7.2 Execute command

To execute the MetalC command, click the MetalC command from the context menu.

The command uses the specified properties.

[pic]

The command execution is shown summarised in the Progress tab

[pic]

The Remote Console shows the execution log

[pic]

Appendix 1 - Other script variants

Another variant to invoke a UNIX script involves specifying the command and parameters in the Command field and activating the Remote Command checkbox.

When a UNIX script is to be invoked, the fully-qualified name must be specified. In addition to the previously-mentioned substitution variables, &PROMPT variables can also be specified (and will be honoured in this case). As the name implies, &PROMPT variables allow prompting for the current parameter value.

Example

/u/t02161a/script/metalc3.cmd &RN &X &PROMPT_LIST("SYSLMOD:",{TEST.LOAD;PROD.LOAD},"required","") &PROMPT_TEXT("MODNAME:","","")

[pic]

Note: The “Show output in dialog” checkbox should not be enabled in this case. Reason: If enabled, any errors will not be available after completion of the script processing.

The associated Script Configuration entry should specify the standard Header script (bbshtpf.bbs). bbshtpf.bbs, contained in the directory referenced by the TPFSHARE environment variable, creates the environment. Entries for Command Header (default: bbshcmd.bbs), Command Footer (default: bbsfcmd.bbs), Footer (default: bbsftpf.bbs) are not normally required.

[pic]

Note

RDz creates a default bbshtpf.bbs file which may need to be customised. The supplied bbshcmd.bbs, bbsfcmd.bbs, and bbsftpf.bbs files are dummy (namely, have no function) but can be coded if required.

Command execution sequence

┌────────────────┐

│ Header │

├────────────────┤

│ Command Header │

├────────────────┤

Command specified in the “Command:” box

├────────────────┤

│ Command Footer │

├────────────────┤

│ Footer │

└────────────────┘

A1.1 – Prompting for interactive substitution parameter values

At execution-time, a single scrollable input mask is presented in which all values can be entered.

[pic]

The following interactive substitution variables are available:

&PROMPT_BROWSE

&PROMPT_TEXT

&PROMPT_BOOL

&PROMPT_ENUM

&PROMPT_NAV

&PROMPT_ORDERED_LIST

&PROMPT_LIST

&PROMPT_BOOL_LIST

A1.2 – Invoked script

The passed arguments are fetched using the $N construct (where N is the parameter number).

Sample Remote Command script to perform a Metal C compilation.

echo metalc3

# assign passed arguments to variables

rn=$1

x=$2

syslmod=$3

modname=$4

echo perform MetalC compilation

xlc -S -v -qmetal $rn

as -v $x.s

ld -v -o "//'$syslmod($modname)'" $x.o

Appendix 2 - List of standard UNIX substitution variables

The shown names are taken from the RDz help. The listed variables are current as of RDz 7.5.1; the available variables may differ for other RDz versions.

Subproject variables

|Variable |Description |

|&A |The remote assemble options from the current set of build options for the selected subproject.|

|&BUILD_OPTION |The name of the current set of build options. If multiple sets of build options are referenced|

| |by a target environment, this is the last selected set of build options. If no sets of build |

| |options have been selected, this is the first set of build options in the list. |

|&BUILD_MECHANISM |The name of the current set of build mechanism options. This is the set of build mechanism |

| |options referenced by the current target environment. |

|&EDITOR_OPTION |The name of the current set of editor options. This is the set of editor options referenced by|

| |the current target environment. |

|&F |The child files of the selected subproject, separated by spaces. |

|&K |The number of files that you selected. |

|&LINK_OPTION |The name of the current set of link options. If multiple sets of link options are referenced |

| |by a target environment, this is the last selected set of link options. If no sets of link |

| |options have been selected, this is the first set of link options in the list. |

|&MENU_OPTION |The name of the current set of menu options. This is the set of menu options referenced by the|

| |current target environment. |

|&N |The subproject name that is selected. |

|&O |The remote compile options from the current set of build options for the selected subproject. |

|&RWD |The Remote Working Directory specified during subproject creation. |

|&RWD_UNC |The full UNC path of the Remote Working Directory. This resolves to \\\. |

|&TARGET_ENV_VARS |The name of the current set of target environment variables. This is the set of target |

| |environment variables referenced by the current target environment. |

|&TENV |The name of the target environment, in context. |

|&U |The name of the action that is being run. |

|&V |The directory where IBM® Rational Developer for System z is installed. |

|&VER |The version (V.R.M.) of IBM Rational Developer for System z. |

|&WD |The drive letter representation of the Remote Working Directory (SMB/NFS mounted paths only). |

File variables

|Variable |Description |

|&A |The remote assemble options from the current set of build options for the selected subproject |

| |. |

|&BUILD_OPTION |The name of the current set of build options. If multiple sets of build options are referenced|

| |by a target environment, this is the last selected set of build options. If no sets of build |

| |options have been selected, this is the first set of build options in the list. |

|&BUILD_MECHANISM |The name of the current set of build mechanism options. This is the set of build mechanism |

| |options referenced by the current target environment. |

|&D |The drive where the file is stored. |

|&DP |The file path, including the drive information. |

|&DPN |The full path of the local file. |

|&DPX |The full path of the local file, excluding the file extension. |

|&EDITOR_OPTION |The name of the current set of editor options. This is the set of editor options referenced by|

| |the current target environment. |

|&HOSTNAME |The host name of the selected file (remote only). |

|&K |The number of files that are selected. |

|&LINK_OPTION |The name of the current set of link options. If multiple sets of link options are referenced |

| |by a target environment, this is the last selected set of link options. If no sets of link |

| |options have been selected, this is the first set of link options in the list. |

|&MENU_OPTION |The name of the current set of menu options. This is the set of menu options referenced by the|

| |current target environment. |

|&N |The file name that is selected. |

|&O |The remote compile options from the current set of build options for the selected subproject. |

|&P |The file path, excluding the drive. |

|&Q |The full path for the parent subproject of the selected file. |

|&R |The path of a remote file, excluding the file name. |

|&R_UNC |The full UNC path of the selection, excluding the file name. This resolves to \\\.|

|&RN |The full path of the remote file. |

|&RN_UNC |The full UNC path of the selection, including the full file name. This resolves to |

| |\\\\filename.ext. |

|&RWD_UNC |The full UNC path of the Remote Working Directory. This resolves to \\\. |

|&RX |The full remote path of the file, excluding the file extension. |

|&RX_UNC |The full UNC path of the selection, including the file name, but not the file name extension. |

| |This resolves to \\\\filename. |

|&S |The parent subproject name of the selected file. |

|&T |The resource type. |

|&TARGET_ENV_VARS |The name of the current set of target environment variables. This is the set of target |

| |environment variables referenced by the current target environment. |

|&TENV |The name of the target environment, in context. |

|&U |The name of the action that is being run. |

|&V |The directory where IBM Rational Developer for System z is installed. |

|&VER |The version (V.R.M.) of IBM Rational Developer for System z. |

|&WD |The drive letter representation of the Remote Working Directory (SMB/NFS mounted paths only). |

|&X |The file name, excluding the extension. |

[pic]

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download