xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
The definition of the two terms in the heading just above is:
The notation in this appendix is:
Syntax is described using typeset courier. Required elements are bold, optional are not bold. If an optional element is omitted, the comma in front of it is to be omitted too.
Elements written using UPPER CASE must be written exactly as stated here (you may use lower case), elements written using lower case must be replaced by a string or a variable containing a value.
Do notice: non-numeric strings in RXS must always be written in quotes.
If nothing is noted below, the concept is a function, and its heritage is REXX. Which means that further information can be found in a REXX manual.
Functions in RXS can be nested - for instance left(date(),2) will create a two digit string containing the current day in the month.
The list below is not exhaustive - any REXX functions and instructions may be used in RXS, except those mentioned in Section 2.
ABS returns the absolute value of a number (stripping of the sign, returning a positive number or zero)
BITAND returns a string containing the two input strings ANDed together bit for bit.
BITOR returns a string containing the two input strings logically ORed together bit for bit.
BITXOR returns a string containing the two input strings logically exclusive ORed together bit for bit.
Binary to hexadecimal - returns a string in character format, representing binary_string converted to hexadecimal.
CALL extprocedure parameter
The external REXX or CLIST program extprocedure is executed, optionally using the parameter parameter. (REXX instruction)
CENTER returns a string of length length containing string centered inside it. pad characters may be added to reach the length.
CHANGE returns a string in which first, last or all occurences of another string, oldval is changed to the string newval. Option is F(irst) L(ast) or A(ll). A is default. (RXS function)
COMPARE compares string1 and string2. COMPARE returns 0 if the strings are identical. If the strings differ, the position of the first character not in match is returned.
COPIES returns n concatenated copies of string.
Character to decimal - returns the decimal value of the binary representation of string. This function converts an IBM 'binary' field to a REXX numeric - for example, if string contains '05A8'x, the REXX numeric '1448' is created.
Character to hexadecimal - converts a string to its hexadecimal representation. This function conterts an IBM 'packed decimal' to a REXX numeric - for example, if string contains '01448D'x, the REXX string '01448D' is created. If the last character is 'D' then multiply by -1. Remove last character.
DATATYPE returns - when only string is specified - NUM if string is a valid REXX number. Otherwise CHAR is returned. If type is specified, 1 is returned if string matches type, otherwise 0 is returned.
DATE returns the actual date in the format dd mmm yyyy (if option is omitted) or in the format according to option. Option can be Base, Century, Days (number of day inside year), European (the format 13/03/92) , Julian, Month, Normal (the format 13 Mar 1992), Ordered, Standard (the format 19920313), Usa, Weekday (the day of the week in letters). Only the first letter of option has to be written.
DELSTR deletes the substring of string starting at the n'th character and being length long.
DELWORD deletes the substring of string starting in the n'th word, being length blank-delimited words long.
Lines in RXS contained inside lines DO and END are considered a block of lines (section 2a) (REXX instruction)
DROPQUEUE removes the queue queue. (See Section 16). (RXS instruction).
DROP restores variables to their original uninitialized state. If name is not enclosed in parentheses, it identifies a variable to drop. If a single name is enclosed in parentheses, then the value of name denotes a subsidiary list of variables to drop. (REXX instruction)
Decimal to character - returns a character-string being the binary representation of the decimal number wholenumber.
Decimal to hexadecimal - returns a character-string being the hexadecimal representation of the decimal number wholenumber.
Lines in RXS contained inside lines DO and END are considered a block of lines (section 2a) (REXX instruction)
The RXS program is halted immediate. If number is written the environment of the RXS program will receive number as return-code (normally in the variable RC). Any updates from the RXS program (DB2, MQ, and writing of files) will be rolled back. If the RXS program is executed directly from an edit-screen or as a command, an informative message is written. (RXS instruction)
FIND searches string to find first appearance of phrase (where phrase is a string of blank-delimited words), returning the number of the word in string where the appearance starts. If phrase is not found, or phrase is empty, 0 is returned.
FORMAT rounds and format number according to the stated: Before states the number of digits before the decimal separator, after states the number of digits after the decimal separator.
Converting a dsname from ISPF naming standard to RXS naming standard: If dsname begins with a quote, qutoes before and after is removed. If no quote is found, dsname is prefixed USERID()".". (RXS function).
GETQUEUE returns the value of unit.2 in the queue queue_name for the entry having unit.1 = element_value (See Section 15). (RXS function)
INDEX returns the position of a string, needle, in another string haystack, starting the examination at start. If the string needle is not found, 0 is returned.
INSERT inserts the string new, padded up to length length, into the string target starting at character n.
INTERPRET executes expression: a string or a variable containing a valid statement in REXX syntax, or several valid statements, separated by ";". Example: interpret "if w = 14 then do;w = w - 1;end" Notice that RXS constructs is not allowed inside expression. (REXX instruction)
The function INTERFACE() using a queue-name in as argument, returns '1' if the indicated queue in has been changed by the user during an edit session using an )interface in the current RXS program (RXS function)
Jump to the beginning of the current block of coding (DO END block) and execute from here. (REXX instruction)
JUSTIFY formats blank-delimited words in string by adding pad characters between the words so that the words fill out length.
LASTPOS returns the last position of a string, needle, in another string haystack, starting the examination at start. If needle is empty or if needle is not found inside haystack, 0 is returned.
Jump past the end of the current block of coding (DO END block) and execute from here (REXX instruction).
LEFT returns a string containing characters from the left of string up to length length.
LENGTH returns the length of string.
The variable with the name varname is made globally accessible. See Section 33. (RXS instruction)
MAX returns the largest number in the list
MIN returns the smallest number in the list.
Dummy instruction with no effect. (REXX instruction)
OVERLAY overlays tartget - starting at the n'th character - with the string new, padded and truncated to length length.
PARSE VAR string varname1 "," varname2 "," varname3
PARSE comes in a lot of flavors. The above form splits a string into three strings. The split occurs when the character ',' is found in string. For other uses of PARSE, see a REXX manual
POS returns the first position of a string, needle, in another string haystack. The examination starts at position start.
Concatenate string at buttom of the current queue. The current queue is normally used to hold sub-commands for tso commands using several sub-commands, like FTP (REXX instruction) (section 33j)
Queuevar returns 1 if queue_element is found in the queue queue_name, otherwise 0 is returned (See Section 14). (RXS function)
RANDOM returns a pseudo random non-negative number in the sequence from min to max inclusive. The difference between min and max may not exceed 100000. A specific seed for the generation may be given.
REVERSE returns the bytes of string in reverse order.
If the RXS program contains a series of prompts (Section 21) the first prompt will re-appear. Otherwise: The RXS program is halted immediate. Any updates from the RXS program (DB2, MQ, and writing of files) will be rolled back. (RXS instruction)
RIGHT returns a string of length length, including the rightmost character of string
expression is written on screen (REXX instruction)
string is presented as a message on the current screen presented to the user, and the execution is temporarely halted - the current screen in a prompt is re-displayed. (RXS instruction).
string is presented as a message on the next screen presented to the user. (RXS instruction).
If number is negative, -1 is returned, if number is zero, 0 is returned, otherwise 1 is returned.
SPACE formats blank-delimited words in string using n pad characters between each word. If n is zero, all blanks are removed.
STRIP removes Leading, Trailing or Both char from string, according to option being L(eading), T(railing) or B(oth). Default is B. Default for char is space.
SUBSTR returns the substring af string starting at the n'th character. If length is omitted, the rest of the string is returned.
SUBWORD returns the substring of string starting at the n'th word, and being length long.
If name is not a valid REXX symbol, BAD is returned. If name is the name of a variable, VAR is returned. Otherwise LIT is returned.
TIME returns local time in the format '14:19:03' if option is not stated. Option is: Civil '2:19pm', Elapsed '0.000028' (number of seconds after reset), Hours '14' (number of hours since midnight), Long'14:09:03.050683', Minutes '859' (minutes since midnight), Normal '14:09:03', Reset (that is: resetting elapsed) and Seconds '51535' (Seconds since midnight). As option you may state the first letter, for instance 'c' for 'civil'.
TIMESTAMP returns the current timestamp in DB2-format:
TRANSLATE 'translates' the characters of string to other characters. If tableo and tablei is not stated, the string is translated to upper case.
TRUNC returns the integer part of number and - if stated - n decimal places.
VALUE returns the value that has been assigned to a variable name, and optionally assigns a new value newvalue to the variable name.
VERIFY verifies that string only contains characters from reference. If true, 0 is returned. If not true, the position of first character in string that is not in reference is returned. If option is 'nomatch', the function is reversed: it returns the position of the first character in string that is in reference. If start is stated, the examination starts at start.
WORD returns the n'th blank-delimited word in string.
WORDINDEX returns the position of the first character in the n'th blank-delimited word in string.
WORDLENGTH returns the length of the n'th blank delimited word in string.
WORDPOS searches string for the first occurrence of the sequence of blank-delimited words, phrase in string. The words in both strings may be separated by any number of blanks. If phrase is not found in string, 0 is returned.
WORDS returns the number of blank-delimited words in string.
Hexadecimal to binary - returns a string in character format representing hexstring binary.
Hexadecimal to character - converts a string of hexadecimal characters to character format.
Hexadecimal to decimal - converts a string of hexadeical characters to decimal