PIPE STRIP
Syntax
STRIP .- --BOTH-----. .- --BLANK---------. |--STRIP--+-------------+--+--------+--+------------------+-----> +- --LEADING--+ +- --TO--+ '- --⁄--charset--⁄-' '- --TRAILING-' '- --NOT-' >--+--------+---------------------------------------------------| '- limit-'
Command Description
The PIPE STRIP stage removes blanks or other specified characters from the beginning or end of message data. Alternately, STRIP removes all characters up to a blank or other specified characters.
You can use the STRIP stage to remove unwanted blanks or other characters before you use the JOINCONT stage.
Streams
| Stream Type | Number Supported |
|---|---|
| Input | 1 |
| Output | 1 |
Termination Conditions
STRIP terminates when the input stream or the output stream is disconnected.
Operand Descriptions
- BLANK
- The default is to remove blanks.
- BOTH
- Removes blanks or other specified characters from both the beginning and the end of the text in the message lines. This is the default.
- ⁄charset⁄
- Specifies the set of characters to be stripped. Order and duplicate
characters are ignored. The delimited set must be specified.
The first nonblank character encountered after the keywords is the delimiter which establishes the boundary of the character set used by the stage. The delimited set ends when the same character is encountered a second time. // is interpreted as a null set.
- LEADING
- Removes blanks or other specified characters from only the beginning of the text in the message lines.
- limit
- The maximum number of characters to be removed by STRIP. If you use BOTH, the limit applies separately to the leading and trailing strip operation.
- TO/NOT
- Removes blanks or other specified characters that are not blank (or not specified). TO and NOT have exactly the same function.
- TRAILING
- Removes blanks or other specified characters from only the end of the text in the message lines.
Usage Notes
- STRIP cannot be the first stage.
- A delimited character set is not recognized as a sequence of characters. Each character is considered individually. If you specified the delimited set /CAT/ with TRAILING, any message ending with an A, C, T, or any combination of those characters is considered a match.
Example: Stripping Leading Characters
A
TAME
ARTFUL
AARDVARK
ATE
THE
APPLE
PIPE < AFILE
| STRIP LEADING /TA/
| CONSOLE
(blank)
ME
RTFUL
RDVARK
E
HE
PPLE
Example: Stripping Sequence Numbers from the End of a Message
For this example, you have established a file member named THISFILE. The records are 80 bytes long and end in eight character sequence numbers.
/* REXX command list */
'PIPE < THISFILE',
'| STRIP TRAILING NOT // 8',
'| STEM OUTLINE.'
