Miscellaneous Functions; Testing Input With Built-In Functions - IBM SC34-5764-01 Manual

Cics transaction server for vse/esa
Table of Contents

Advertisement

Function
Description
WORDPOS
Returns the word number of the first word of a specified phrase in the input string.
WORDS
Returns the number of words in the input string.

Miscellaneous Functions

Function
Description
ADDRESS
Returns the name of the environment to which commands are currently being sent.
ARG
Returns an argument string or information about the argument strings to a program or internal
routine.
BITAND
Returns a string composed of the two input strings logically ANDed together, bit by bit.
BITOR
Returns a string composed of the two input strings logically ORed together, bit by bit.
BITXOR
Returns a string composed of the two input strings eXclusive ORed together, bit by bit.
CONDITION
Returns the condition information, such as name and status, associated with the current trapped
condition.
DATE
Returns the date in the default format (dd mon yyyy) or in one of various optional formats.
ERRORTEXT
Returns the error message associated with the specified error number.
EXTERNALS
This function always returns a 0.
LINESIZE
Returns the width of the current output device.
QUEUED
Returns the number of lines remaining in the external data queue at the time when the function
is called.
SOURCELINE
Returns either the line number of the last line in the source file or the source line a number
specifies.
TIME
Returns the local time in the default 24-hour clock format (hh:mm:ss) or in one of various
optional formats.
TRACE
Returns the trace actions currently in effect.
1
USERID
Returns the current user ID. This is the last user ID specified on the SETUID command, the
user ID of the calling REXX program if one program calls another, the user ID under which the
job is running, or the job name.
VALUE
Returns the value of a specified symbol and optionally assigns it a new value.
XRANGE
Returns a string of all 1-byte codes (in ascending order) between and including specified starting
and ending values.

Testing Input with Built-In Functions

Some of the built-in functions provide a convenient way to test input. When a program uses input, the user
might provide input that is not valid. For instance, in the example of using comparison expressions on
page 24, the program uses a dollar amount in the following instruction.
PARSE PULL yesterday /* Gets yesterday's price from input stream */
If the program pulls only a number, the program processes that information correctly. However, if the
program pulls a number preceded by a dollar sign or pulls a word, such as nothing, the program returns
an error. To avoid getting an error, you can check the input with the DATATYPE function as follows.
IF DATATYPE(yesterday) \= 'NUM'
THEN DO
SAY 'The input amount was in the wrong format.'
EXIT
END
Using Functions
Chapter 5. Using Functions
55

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rexx

Table of Contents