IBM SC34-5764-01 Server User Manual


 
returns an argument string or information about the argument strings to a program or internal routine.
If you do not specify n, the number of arguments passed to the program or internal routine is returned.
If you specify only n, the nth argument string is returned. If the argument string does not exist, the null
string is returned. The n must be a positive whole number.
If you specify option, ARG tests for the existence of the nth argument string. The following are valid
options. (Only the capitalized and highlighted letter is needed; all characters following it are ignored.)
Exists returns 1 if the nth argument exists; that is, if it was explicitly specified when the routine was
called. Returns 0 otherwise.
Omitted
returns 1 if the nth argument was omitted; that is, if it was not explicitly specified when the routine
was called. Returns 0 otherwise.
Here are some examples:
/* following "Call name;" (no arguments) */
ARG() -> 0
ARG(1) -> ''
ARG(2) -> ''
ARG(1,'e') -> 0
ARG(1,'O') -> 1
/* following "Call name 'a',,'b';" */
ARG() -> 3
ARG(1) -> 'a'
ARG(2) -> ''
ARG(3) -> 'b'
ARG(n) -> '' /* for n>=4 */
ARG(1,'e') -> 1
ARG(2,'E') -> 0
ARG(2,'O') -> 1
ARG(3,'o') -> 0
ARG(4,'o') -> 1
Notes:
1. The number of argument strings is the largest number n for which ARG(n,'e') would return 1 or 0 if
there are no explicit argument strings. That is, it is the position of the last explicitly specified argument
string.
2. Programs called as commands can have only 0 or 1 argument strings. The program has 0 argument
strings if it is called with the name only and has 1 argument string if anything else (including blanks) is
included with the command.
3. You can retrieve and directly parse the argument strings to a program or internal routine with the ARG
or PARSE ARG instructions. (See pages “Purpose” on page 134, 152, and 203.)
BITAND (Bit by Bit AND)
 BITAND(string1
,
string2 ,pad
) 
returns a string composed of the two input strings logically ANDed together, bit by bit. (The encodings of
the strings are used in the logical operation.) The length of the result is the length of the longer of the two
strings. If no pad character is provided, the AND operation stops when the shorter of the two strings is
exhausted, and the unprocessed portion of the longer string is appended to the partial result. If pad is
provided, it extends the shorter of the two strings on the right before carrying out the logical operation. The
default for string2 is the zero length (null) string.
Here are some examples:
Functions
176
CICS TS for VSE/ESA: REXX Guide