ARG Instruction

The ARG instruction takes information passed as arguments to a program, function, or subroutine, and puts it into one or more variables. To pass the three arguments Knowledge is power. to a REXX program named sample:
  1. Call the program and pass the arguments as a string following the exec name:
    REXX sample Knowledge is power.
  2. Use the ARG instruction to receive the three arguments into variables.
    /* SAMPLE -- A REXX program using ARG  */
       ARG word1 word2 word3
            /* word1 contains 'KNOWLEDGE'  */
            /* word2 contains 'IS'         */
            /* word3 contains 'POWER.'     */

ARG uppercases the character information before assigning the arguments into variables.

If you do not want uppercase translation, use the PARSE ARG instruction instead of ARG.
/* REXX program using PARSE ARG        */
  PARSE ARG word1 word2 word3
        /* word1 contains 'Knowledge'  */
        /* word2 contains 'is'         */
        /* word3 contains 'power.'     */

PARSE UPPER ARG has the same result as ARG. It uppercases character information before assigning it into variables.


Reference Reference

Feedback


Timestamp icon Last updated: Tuesday, 7 January 2014


http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/topic/com.ibm.cics.rexx.doc//dfhrx/dfhrx00061.html