Previous Topic: &QEXIT

Next Topic: &RETCODE


&REMSTR

Returns the data following the first occurrence of a specified character in a supplied string.

&REMSTR (c) text

&REMSTR is a built-in function and must be used to the right of an assignment statement.

&REMSTR will scan the specified data looking for the nominated selection character and returns the data following it into the target variable.

&REMSTR is used in conjunction with &SELSTR to split and manipulate strings of data.

&SELSTR assigns the data up to the nominated search character into the nominated variable. &REMSTR assigns the data following the nominated search character into the nominated variable.

Operands:

(c)

The selection character. The scan will be terminated at the first occurrence of the character 'c'. If this character is not found the target variable will be set to null.

The data assigned to the target variable will not include the selection character.

If the selection character is a blank then a space should be specified. Where the selection character is a blank that is one of many successive blanks, only the first blank will be dropped. To eliminate multiple leading blanks in a variable, use either the &LBLSTR built-in function or the &PARSE verb.

text

The string of data to be split at the specified character.

Examples: &REMSTR

&MMSS = &REMSTR (.) &TIME  -* If &TIME is currently
                           -* 09.23.50
                           -* then &MMSS will be set
                           -* to 23.50

Notes:

&REMSTR is used with data returned from full-screen panels where it is necessary to internally manipulate the data for further processing.

Having split a string using &REMSTR, the &NBLSTR, &TBLSTR and &LBLSTR functions is used to strip leading and/or trailing blanks as necessary. It may be desirable to use &PARSE, where complex parsing is required.

If &CONTROL DBCS or DBCSN or DBCSP is in effect, &REMSTR is sensitive to the presence of DBCS data.

More information:

&PARSE

&SELSTR