CASEI
v1.1
v2.1

Purpose, Argument, Streams, Usage, Examples, Related

Syntax

>>──stage──CASEI(─┬─────────────────┬──┬─────────┬─)──┬──────────┬───────────────────>< 
                  └─ZONEinputrange─┘  └─REVerse─┘    └─argument─┘
Purpose

Use the CASEI pre-process function to alter the input records read by the stage from any of its input streams. The CASEI function operates on the input records before they are presented to the stage.

There are a number of stages that permit the use of the CASEI function and these are stages that do not perform any translation of their input records. They are purely filter type stages that simply select input records based on some criteria. The CASEI function instructs the manager to; translate both the stage operands and the content of the input records to uppercase, and optionally, extract a substring of the record specified by the inputrange argument and to present this altered record to the stage when a read-record is requested. The CASEI function does not alter the way in which a stage processes its input and output records, it only alters the format of the record which is presented to the stage. When the stage performs a subsequent write-record request, the manager writes the original unmodified input record to the specified output stream.

Argument
Streams
Usage
  1. You cannot specify the CASEI preprocess function with a stage that does not support it.

  2. A stage that supports the CASEI preprocess function does not delay the records.

  3. The CASEI function translates input records to uppercase before they are presented to the stage. As such, if the stage searches for a hexadecimal or binary representation of a lowercase character; the stage will not find the character because the input record has already be translated to uppercase, as in the following example:

    **** Top of file ****
    Address Rxpipe
    'pipe literal /aBbCc def ghi/', '| split', '| between casei( zone 3-* ) x62 /b/', '| console'
    Exit 0 **** End of file ****

    The lowercase b (x'62') in the literal string is not found because it was translated to an uppercase B before BETWEEN processed its input record. Similarly, if the stage specifies a word or field range with a word or field separator string in hexadecimal or binary format, then the extracted range may not be as expected as the record presented to the stage will have been translated to uppercase.
Examples
  1. In the following example, the pipeline specifies only word number 2 as the input location:

    **** Top of file ****
    Address Rxpipe
    'pipe literal /a-B-c c-b-A/', '| split', '| fromlabel casei( zone wordsep /-/ w2 ) /b/', '| console'
    Exit 0 **** End of file ****

    output:
    a-B-c c-b-A

  2. The following pipeline specifies the third-from-last to the second-from-last columns as the input location:

    **** Top of file ****
    Address Rxpipe
    'pipe literal /ABCDE FGHIJ/', '| split', '| tolabel casei( zone -3;-2 ) /hi/', '| console'
    Exit 0 **** End of file ****

    output:
    ABCDE
Related

BETWEEN, FROMLABEL, INSIDE, LOCATE, NOTLOCATE, OUTSIDE, TOLABEL, ZONE

History

Version
Date
Action
Description
Pipelines
1.1
??.??.2025
changed
Application-wide rewrite
2.1
1.0
06.09.2007
created
First version.
1.0