Pick records based on matching criteria

Filter:

PICK

Syntax:

PICK [PAD padchar | NOPAD] [ANYCASE] match_argument_1 compararator match_argument_2 [columnrange] expression

Operands:

match_arguments :: string_expression | columnrange | separator inputrange
columnrange :: start_column-end_column
columnrange :: start_column.number_of_columns
columnrange :: start_column;end_column
start_column :: integer | 1
end_column :: integer | *
string_expression :: character_string | hexstring
character_string :: delimiter character_string delimiter
hexstring :: X||*hex_number | H||*hex_number
delimiter :: any character not used in the locate string
separator :: (WORDSEPARATOR | WORDSEP | WS ) (BLANK | SPACE)
inputrange :: Word wordnumberrange
wordnumberrange :: start_wordnumber '-' end_wordnumber

Functional Description:

Use the PICK stage to compare a field in the primary input stream record to a specified string or a second field in the record, and to select the record if the comparison satisfies the specified relation. PICK writes selected primary input stream records to its primary output stream if it is connected. Records that do not match the specified relation are written to the secondary output stream if it is connected, otherwise they are discarded.

If ANYcase is not specified, uppercase and lowercase representations of the same characters do not compare equally. For example, a comparison satisfies a specified relation only if the content of the input record exactly matches the target string you specify.

NOPAD specifies that two comparison fields should be of equal length. If one field is shorter than the other it is not padded. Input ranges that are specified in the input record must have the same length to be considered equal. This is the default.

PAD specifies that the shorter of two comparison fields is extended on the right with a pad character.

char

hexchar is the single character, char, or the 2-character hexadecimal representation of a character, hexchar, used for padding. Do not enclose the hexadecimal representation in quotation marks.

BLANK
SPACE specifies that a blank is used as the pad character.

ANYcase specifies that the case of letters being compared is ignored. The default is to respect case when comparing fields.

/(diagonal) signifies any nonblank delimiting character that does not appear in string.

You cannot use a B, b, X, x, H, h, % , (, or ) for a delimiting character.

string1
string2 specifies a string of characters (constants) to be compared. If no operands are specified before string and if string consists of only decimal numbers (0-9), you cannot specify a left parenthesis or a number as the delimiting character.

Hhexstring and Xhexstring:
defines a target string of hexadecimal characters, following the X or H, that defines a target string of characters to be located. The X or H can be specified in uppercase or specify. lowercase. You must not specify any spaces in the string. There must be an even number of hexadecimal characters in the string.

FIELDSEPARATOR is not supported.

negative locations on column range is not supported.

Secondary Input/Output:

OUTPUT

Synonyms:

none

Usage Notes:

The following example will split the line into 2 and pick both records because the string in column 1 is not equal to the string in column2.

LITERAL cullenprogramming geoffrey | split | pick 1 ¬== 2 | console

The following example will pick all records where the data in columns 1 through 10 is greater than that in columns 90 through 100.

| PICK 1.10 >> 90.10 |

The following example will pick all records where the data in columns 1 through 10 is equal to the supplied hex string.

| PICK PAD 20 1.10 == XE2E3F4202121 |

The following example will pick all records where the data in columns 1 through 10 is equal to the supplied hex string. All unmatched records will go the the secondary output.

| a: PICK PAD 20 1.10 == XE2E3F4202121 | .... b: | console


JAVA Pipelines

Cullen Programming logo