Introduction

Variable Actions are operations on files/ Job variables/ library elements that require one or more parameters for their execution, other than the name of the data object. A simple example is the operation of transfering a file from one disc drive to another. In addition to the name, the Volume Serial Number (VSN) and device type need to be specified.

Variable Actions are particulary useful if a complex set of operations needs to be carried out on a number of data objects (files/library elements/Job variables). For CFS batch applications, the Variable Actions defined in the ON& ... form are suitable.

The counterpart to a Variable Action is the Action Code, which is a 1 to 5 character code entered next to the name of a particular data object. This code, e.g. P (= Print), PSE (= Print ,Space=E,Erase), E (= Erase), ED (= Erase, Destroy), etc. will process the operation for that file only.

No further parameterisation is necessary for these Action Codes, apart from the name of the data object. All available parameters can be entered as part of the Action Code.

For simple operations on a small number of data objects, these direct Action Codes are easier to handle, as well as having the advantage that most of them are processed immediately. They do not have to be collated and processed later on, as do Variable Actions. In addition, the step of defining the Variable Action is eliminated.

All Variable Actions start with: ONX... or ON&...

ONX... The Variable Action is only carried out for the data objects (files/Job variables/ library elements) that have been explicitly marked by the user with the Action Code X or XE/Xt (see page 6-).

ON&... The Variable Action is automatically carried out for all entries in the file list, without an X Action Code needing to be entered.

Only the generic form ONX.... will be described in this Chapter.

Some of the following Variable Actions may be entered in the CFS command field as an individual command, or as an Action Code.

The Variable Actions can be entered as such in the command field as well as in the initial selection mask.

Variable Actions and Parameter Sets

All Variable Actions are defined in the form ONX varact [params] or ON& varact [params] . varact is the name of the Variable Action. params are optional parameters associated with that Variable Action.

Examples:

ONX/MOD-FILE-ATTR PROTECT=*PAR(ACCESS=*READ)

ON&FT HOST21,TSOS,ADMINSTR,C'....',DO.SUCCESS,*,DO.FAIL,*

Instead of ONX varact [params], the Variable Action can also be specified as ONX %name [,jrsave] . %name is the name of a parameter set under which the Variable Action had previously been saved. For further information, see the SP VAR%name [,jrsave] command in the CFS file list. jrsave is the name of a specific file if it is to differ from the standard JRSAVE file.

ONX %name [,jrsave] ,? will display the Variable Action stored in the named Parameter Set.

ONX %? will display the Variable Actions stored in all Parameter Sets.

Specifying a Variable Action by means of a parameter set is particularly useful when executing complicated SDF commands which have had to be created using the SDF dialog facility.

Example:

ON&/MOD-FILE-ATTR?

Prompted SDF dialog. The parameter structure of the command can then be filled in.

SP VAR%MFA,CFS.JRSAVE.TEST

This CFS command will cause the SDF command completed using the prompted SDF dialog facility to be saved in a parameter set called %MFA, to the file CFS.JRSAVE.TEST.

The full SDF command can then be re-activated during a later CFS session by means of the following Variable Action: ONX%MFA,CFS.JRSAVE.TEST

Entering ONX%MFA,CFS.JRSAVE.TEST,? will cause an SDF screen to be displayed containing the command and the parameters saved in the parameter set. These can then be overwritten if required.

Name Transformation Rules 'str1'='str2' | 'str1'=DS[n][I] | 'str1'=DP[n][I]

All Variable Actions corresponding to the form ONX...'str1'='str2', which creates a data object name-2 from name-1, adhere to one of the following rules:

'str1'='str2' The first occurrence of character string 'str1' in name-1 will be replaced by 'str2'. The result will be name-2.

'str1'=DP[n][I] Delete Prefix: In name-1 the first occurence of the string 'str1' will be sought. All (=DP), or the next n characters left of 'str1' (=DPn) will be deleted. Including the option I will cause the search string 'str1' to be deleted. The result will be stored in name-2.

'str1'=DS[n][I] Delete Suffix: In name-1 the first occurence of the string 'str1' will be sought. All (=DS), or the next n characters right of 'str1' (=DSn) will be deleted. Including the option I will cause the search string 'str1' to be deleted. The result will be stored in name-2.

If 'str1' is not contained in name-1, the Variable Action will not be executed for that data object.

By default, every name is suffixed with '_'. Thus, '_'='.xxx' will append a suffix to a data object. Or, for example, '_'=DP5 will delete the last five characters from the end of the name.

By default, a null string, '' , prefixes every name. ''='xxx.' will thus put a prefix of 'xxx.' on the name.