z/OS TSO/E REXX User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


ARG Instruction

z/OS TSO/E REXX User's Guide
SA32-0982-00

The ARG instruction takes information passed as arguments to an exec, function, or subroutine, and puts it into one or more variable names. Before character information is put into a variable name, ARG changes it to uppercase. When ARG is followed by more than one variable name, it parses the information into the available variable names. For example, if an exec named USERID.REXX.EXEC(QUOTE) can receive arguments, you can invoke the exec with the EXEC command and the three arguments as follows:
EXEC rexx.exec(quote) 'Knowledge is power.' exec
The exec receives the arguments with the ARG instruction as follows:
ARG word1 word2 word3
                                    /* word1 contains 'KNOWLEDGE'  */
                                    /* word2 contains 'IS'         */
                                    /* word3 contains 'POWER.'     */
The PARSE ARG instruction assigns information, without altering it, to variable names.
PARSE ARG word1 word2 word3
                                    /* word1 contains 'Knowledge'  */
                                    /* word2 contains 'is'         */
                                    /* word3 contains 'power.'     */

PARSE UPPER ARG causes the same result as ARG in that it changes character information to uppercase before assigning it to one or more variables.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014