Subword, Symbol, Time – IBM SC34-5764-01 User Manual

Page 215: Subword symbol time

Advertising
background image

SUBWORD

SUBWORD(string,n

,length

)

returns the substring of string that starts at the nth word, and is up to length blank-delimited words. The n
must be a positive whole number. If you omit length, it defaults to the number of remaining words in string.
The returned string never has leading or trailing blanks, but includes all blanks between the selected
words.

Here are some examples:

SUBWORD('Now is the

time',2,2)

->

'is the'

SUBWORD('Now is the

time',3)

->

'the

time'

SUBWORD('Now is the

time',5)

->

''

SYMBOL

SYMBOL(name)

returns the state of the symbol named by name. Returns BAD if name is not a valid REXX symbol. Returns
VAR

if it is the name of a variable (that is, a symbol that has been assigned a value). Otherwise returns

LIT

, indicating that it is either a constant symbol or a symbol that has not yet been assigned a value (that

is, a literal).

As with symbols in REXX expressions, lowercase characters in name are translated to uppercase and
substitution in a compound name occurs if possible.

Note: You should specify name as a literal string (or it should be derived from an expression) to prevent

substitution before it is passed to the function.

Here are some examples:

/* following: Drop A.3;

J=3 */

SYMBOL('J')

->

'VAR'

SYMBOL(J)

->

'LIT' /* has tested "3"

*/

SYMBOL('a.j')

->

'LIT' /* has tested A.3

*/

SYMBOL(2)

->

'LIT' /* a constant symbol

*/

SYMBOL('*')

->

'BAD' /* not a valid symbol */

TIME

TIME(

option

)

returns the local time in the 24-hour clock format: hh:mm:ss (hours, minutes, and seconds) by default, for
example, 04:41:37.

You can use the following options to obtain alternative formats, or to gain access to the elapsed-time
clock. (Only the capitalized and highlighted letter is needed; all characters following it are ignored.)

Civil

returns the time in Civil format: hh:mmxx. The hours may take the values 1 through 12, and the
minutes the values 00 through 59. The minutes are followed immediately by the letters am or pm.
This distinguishes times in the morning (12 midnight through 11:59 a.m.—appearing as 12:00am
through 11:59am) from noon and afternoon (12 noon through 11:59 p.m.—appearing as 12:00pm
through 11:59pm). The hour has no leading zero. The minute field shows the current minute (rather
than the nearest minute) for consistency with other TIME results.

Elapsed

returns sssssssss.uuuuuu, the number of seconds.microseconds since the elapsed-time clock

Functions

Chapter 14. Functions

193

Advertising