z/OS TSO/E Command Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example 8

z/OS TSO/E Command Reference
SA32-0975-00

Operation: Pass an argument string containing values separated by commas to a REXX exec.

Known:
  • The REXX exec named GETARG is contained in a REXX library named REXX.EXEC, which is allocated to file SYSEXEC.
  • The REXX exec consists of:
    PARSE ARG A ',' B
    SAY 'Value of A is:' A
    SAY 'Value of B is:' B
Implicit form:
GETARG 1,2
Extended implicit form:
%GETARG 1,2
Explicit form:
ex 'REXX.EXEC(GETARG)' '1,2'
Note: If you want to pass an argument string that contains values separated by commas and the first value is null (that is, the argument string begins with a comma), then the explicit form must be used.
For example, to pass the argument string ",3" to the GETARG exec, you must specify:
ex 'REXX.EXEC(GETARG)' ',3'
In this case, GETARG is passed the two character argument string ",3". The PARSE ARG A ',' B instruction parses the argument string to obtain a null value for A, and a value of 3 for B.
If an implicit invocation is used, the leading comma is stripped from the argument string passed to the exec. That is,
GETARG ,3
results in the 1 character string "3" being passed to the exec.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014