![]() |
ONXDO Process Files / Lib.Elements with a DO Procedure
ONXDO [n] ['str1'=... ] { file | library(element) | %name } [, do-params | ?]
All the flagged files / Library elements / Job variables will be processed in conjunction with a specified DO procedure. This will be achieved by using the flagged file or element name as the first positional parameter of the DO procedure. A main procedure will be created and a CALL made to the subprocedure. Finally, a branch is made to Connection n, and a DO command is executed for the main procedure.
n Connection number under which the created procedure should be executed. This connection must already exist, and must be under the same userid as the basic process of CFS. If no Connection number is specified, the DO procedure will be created but not executed.
'str1'=... Name transformation rules. For further information, see page 5-.
If 'str1'='str2' is not specified, the name of the procedure will be created from the specified data object in the following form:
a) Files/Job variables full file/JV name
b) FMS library element full element name
c) LMS library element the first eight characters of the element name (LMS-ISAM)
d) PLAM library elements Element name without type and version number
If 'str1'='str2' is specified, the name, as described above, will be passed to the subprocedure as a parameter, but with string 'str1' being replaced by 'str2'. If the original name does not contain 'str1', the unaltered name will be used.
Examples:
...'CFS.S.'=''... The prefix 'CFS.S.' will be removed from the name
...''='CFS.S.'... The name will be prefixed with 'CFS.S.'
...'.SRC '=''... The suffix '.SRC' will be removed from the name
...' '='.SRC'... The names will be suffixed with '.SRC'
file Name of the DO procedure to be processed in conjunction with the marked files/library elements.
lib(element) The DO procedure is stored as a library element as specified. In PLAM libraries, it must be a type J element.
%name Name of the parameter set in the JRSAVE file. The parameter mask saved with the command SP %name will be presented. Using %name will create a relationship between a particular DO proc and predefined parameters.
do-params additional DO procedure parameters. These may not be specified together with %name.
? The parameter mask will be displayed. Normally, it is only displayed if parameters other than the first positional parameter (the file name) have not been specified.
Notes:
The procedure specified in the ONXDO statement must contain at least one positional parameter. CFS will provide the marked data object as this first positional parameter when starting the procedure.
If library elements are processed with ONXDO, the DO procedure must contain at least one other parameter for the library name. This should be specified in the definition of the Variable Action in the parameter mask.
The Variable Action ONXDO will create a DO procedure which contains the CALL for the sub-procedure with the marked files as positional parameters. This DO procedure will be named CFS.DO.tsn.hhmmss. tsn is the TSN of the CFS basic task, and hhmmss is the current time. The user is responsible for erasing this procedure.
In addition to the ONXDO Variable Action, see also the Variable Action ONXENTER on page 5-.
Example:
ONXDO1 CFS.DO.CONVERT
The procedure CFS.DO.CONVERT contains the following PROC statement:
/PROC C,(&FILE),SUBDTA=&
Assume that the user has selected files from his or her own userid, and that a connection has been opened with OC1/ to the same userid. All files marked with an X will be processed with the procedure CFS.DO.CONVERT. First, a temporary procedure called CFS.DO.4711.161411 (161411 = current time) will be created containing the following statements:
/PROC C
/CALL CFS.DO.CONVERT,(name-1,)
/STEP
/CALL CFS.DO.CONVERT,(name-2,)
/STEP
.....
/ENDP
After creating the procedure, CFS branches to the connection specified in the ONXDO command (Connection 1 in this example), and enters the BS2000 command /DO CFS.DO.4711.161411 from there. The user must erase the procedure afterwards if it is not required.