Formatted Selection Criteria panel


The Formatted Selection Criteria screen, shown in the following figure, allows you to specify selection of records based on field values displayed with a record layout.

Select option 2 on the Selection Criteria Menu to display the Formatted Selection Criteria screen. If you did not specify a record layout or XREF file prior to selecting option 2, File-AID/RDX displays the Record Layout Specification screen, shown in Record Layout Specification Screen, for entry of the required information.

Formatted Selection Criteria Screen

 File-AID/RDX --- Formatted Selection Criteria ---------------------------------
 Command ===>                                                  SCROLL ===> CSR
 CRITERIA NUMBER:  1 OF  1  EMPLOYEE-MASTER-FILE                 GBL = N
 ---- FIELD LEVEL/NAME ------- -FORMAT- RO ----+----1----+----2----+----3----+-
 ******************************* TOP OF DATA ********************************
 5 EMP-NUMBER                    5/AN
 5 EMP-LAST-NAME                15/AN
 5 EMP-FIRST-NAME               10/AN
 5 EMP-MID-INIT                  1/AN
 5 FILLER                        2/AN
 5 EMP-TITLE                    30/AN
 5 EMP-PERSONAL-INFO SYNC       23/GRP
   10 EMP-NATL-ID-NUMBER         9/NUM
   10 FILLER                     1/AN
   10 EMP-DATE-OF-BIRTH          6/AN
   10 EMP-DOB-REDEF REDEFINES EMP-DATE-OF-BIRTH
   10 EMP-DOB-REDEF SYNC         6/GRP
     15 EMP-DOB-MM               2/NUM
     15 EMP-DOB-DD               2/NUM
     15 EMP-DOB-YY               2/NUM
   10 EMP-HIRE-DATE              6/AN
   10 EMP-MARITAL-STATUS         1/AN
 5 EMP-WITHOLD-INFO SYNC        15/GRP
   10 EMP-LIFE-INS-WITHOLD-AMT   6/SNUM


The input fields in this screen are:

RO

Specify a relational operator. Possible values are:

Value

Description

EQ, =

Equal to

NE, ¬ =, !=

Not equal to

GT, >

Greater than

GE, > =

Greater than or equal to

LT, <

Less than

LE, < =

Less than or equal to

CO

Contains; scans the specified field for the presence of a data value. CO works on an equal condition.

NC

Not contains; scans the specified field for the absence of a data value. NC works on a not equal condition.

BT

Between; within a range of two values (endpoints inclusive). The value is greater than or equal to the first endpoint and less than or equal to the last endpoint.

NB

Not between; outside a range of two values (endpoints exclusive). The value is less than the first endpoint or greater than the last endpoint.

VA

Valid numeric or packed data based on the field format.

NV

Not valid numeric or packed data based on the field format.

FM

Field mask. For more information, see Field Mask.

Important

The CO and NC relational operators can be specified only for alphanumeric fields (PIC X for COBOL; CHAR or PIC X for PL/I).

File-AID/RDX does not currently support selection criteria that use numeric fields that specify a leading and/or separate sign.

data value

For fields with relational operators other than BT and NB, you specify the field value to use in the comparison. For relational operators BT and NB, specify your Data Value as two values separated by a colon (:). The values may be hex strings, character strings, or numeric tests.

To compare an alphanumeric field to blanks (hexadecimal 40s), leave the data value column blank.

Guidelines

To specify a formatted selection criterion, enter the relational operator and data value beside a field on which you want to base the record selection. Leave the relational operator blank for fields not involved in the selection criteria. Use the INPUT, INSERT, or REPEAT primary command to specify multiple sets of formatted selection criteria. Add the keyword AND to those primary commands to add an ANDed subset to the current criteria set.

In theory, you can create any number of sets of selection criteria. However, the actual number is limited by available storage. Storage is primarily affected by the number of relational operators used and the size of the fields being referenced. The number of ANDed subsets is limited to 255 for any one set.

Multiple fields for a single criterion test are logically ANDed together, multiple AND subsets are ANDed together, and multiple sets of criteria tests are logically ORed together.

Each ANDed Subset is processed as a part of the preceding Set as a group of conditions. An OR Set represents a new group of conditions. Consider the following Sets:


 SET 1   

OR

 SET 2.1     (Subset 1 of Set 2)

AND

 SET 2.2     (Subset 2 of Set 2)

OR

 SET 3         

This criteria will be processed as (SET 1) OR (SET 2.1 AND SET 2.2) OR SET 3.

Multiple data entries can be specified for one field by separating each entry with a comma. The comma is interpreted as an OR expression. You can specify multiple data values for one field on one selection screen. For example: RECORD-CODE   EQ   A,B,C is interpreted as the RECORD-CODE field must be equal to A or B or C.

The syntax of the search data is important since File-AID/RDX interprets a comma as an OR expression. In order to search for a comma as data, enclose the comma in double quotes (",").

For relational operators BT and NB, enter two values separated by a colon (for example, BT -100:+100). In most cases, you will have sufficient space to enter the two values.

You can select records with an invalid field value by entering the NV relational operator. Records with a valid field value can be selected by entering the VA relational operator. The VA and NV operators can be used for packed decimal, and zoned decimal fields.

Relational operators CO and NC can be used to scan a field within each record for the presence or absence of a particular value. The value for which you want to search is entered in the data value column. Trailing blanks in the data value are ignored and not included in the search string. The CAPS primary command controls whether File-AID/RDX does a case-sensitive search. When you enter CAPS OFF, only text exactly matching the upper and lowercase characters is found (for example, SMITH and Smith are different values). When you enter CAPS ON, File-AID/RDX treats upper, lower, and mixed-case characters the same and matches any case combination of the specified characters.

Japanese DBCS Data

DBCS data is accepted as selection criteria data values for alphanumeric fields. For the relational operators CO (contains) and NC (not contains), File-AID/RDX removes any leading or trailing shift characters unless the value is enclosed in double quotes.

Bit Mask Data

Bit Mask data must be 0s or 1s, neither colon ( : ) nor comma ( , ), must be the same length as the number of bits in the bit field, and up to 255 bits supported.

Bit Mask data must have at least one 1 for Relational Operator EQ, NE and NO, at least two 1s for Relational Operator MX.

Sample Selection Sets

Formatted Selection Criteria Examples

File-AID/RDX --- Formatted Selection Criteria ---------------------------------
Command ===>                                                  SCROLL ===> CSR
CRITERIA NUMBER:  1 OF  2  EXAMPLE-FILE                    LAYOUT LENGTH:     3
---- FIELD LEVEL/NAME ------- -FORMAT- RO ----+----1----+----2----+----3----+-
******************************* TOP OF DATA ********************************
5 FIELD-ONE                     1/AN   =  A,B,C
5 FIELD-TWO                     1/AN   =  D
5 FIELD-THREE                   1/AN
***************************** BOTTOM OF DATA *******************************
File-AID/RDX --- Formatted Selection Criteria ---------------------------------
Command ===>                                                  SCROLL ===> CSR
CRITERIA NUMBER:  2 OF  2  EXAMPLE-FILE                    LAYOUT LENGTH:     3
---- FIELD LEVEL/NAME ------- -FORMAT- RO ----+----1----+----2----+----3----+-
******************************* TOP OF DATA ********************************
5 FIELD-ONE                     1/AN
5 FIELD-TWO                     1/AN
5 FIELD-THREE                   1/AN   =  E
***************************** BOTTOM OF DATA *******************************

The formatted conditions specified in the above figure translate into the following expression:

If ((A or B or C) and D) or E 

which can also be stated as:

If (A and D) or (B and D) or (C and D) or E 

Primary Commands

The following is a list of the primary commands that are valid on the Formatted Selection Criteria screen.

ALIGN (AL)

Controls display of ALIGNED/UNALIGNED term for PL/I data.

ARRAY (AR)

Controls display of array declaration information for PL/I data.

ON

Displays an array definition line for each subscripted item in a record layout.

OFF

Does not display an array definition line.  

ALL

Displays all occurrences separately with the subscript(s) and any criteria entered on a specific occurrence will only be applied to that occurrence. This additional parameter is only valid during Formatted Selection Criteria creation.

ANY

Displays a single entry for the occurrences and any criteria entered for the ANY occurrence will be applied to all occurrences. The record will meet the Selection Criteria if any of the occurrences meet the specified criteria. This additional parameter is only valid during Formatted Selection Criteria creation. ANY is applied for initial display of Selection Criteria.

When applying 2 or more criteria in the same subset, all have to be true in the same occurrence to be selected.

When entered individually in different subsets, they don’t have to be true in the same occurrence to be selected.

EVERY

Displays a single entry for the occurrences and any criteria entered for the EVERY occurrence will be applied to all occurrences. The record will meet the Selection Criteria if all of the occurrences meet the specified criteria. This additional parameter is only valid during Formatted Selection Criteria creation.

Guidelines

  • Use the PROFILE command to display the current ARRAY ON or OFF value. Only ON or OFF are saved in the profile.
  • The array line contains the name of the array followed by the word ARRAY and the subscript bounds in standard PL/I format. If any of the subscripts are defined by a REFER clause, additional lines that follow the ARRAY line describe each REFER variable.
  • ANY, EVERY and ALL are available only in Formatted Selection Criteria.
  • ANY, EVERY or ALL is applied per set or subset if any. Each set or subset may have a different array setting.
  • You cannot switch ANY, EVERY or ALL to another if the criteria is specified on any occurrence field in a single set or single subset.
  • In ANY or EVERY mode, the SHOW OFFSET command shows the offsets of the first occurrence.

BACK

Positions the display to the previous criteria. Synonym for LEFT.

CANCEL (CAN)

Returns to main panel without saving current updates.

CAPS

Sets caps mode. CAPS ON is not case-sensitive in the search to match the selection criteria. Specify CAPS OFF for a case-sensitive search. This command is valid only on a new criteria display.

COMPLEX (CMPLX)

Controls display of COMPLEX terms for PL/I data.

DELETE (DEL, D) 

Delete a selection set or subset.

DISPLAY (DIS)

Specifies a display format.

MAXREFER

(for PL/I layouts only) Specify the maximum number of occurrences to display. Omission of the DISPLAY MAXREFER command causes PL/I Refers to default to 1 occurrence.

DOWN

Scrolls down.

END (E)

Terminates display of the Formatted Selection Criteria screen and returns to the Selection Criteria Menu.

FILLER (FILL)

Controls display of FILLER fields.

FORWARD (FWD)

Positions the display to the next criteria. Synonym for RIGHT.

GROUP

Controls the display of occurrences of group-level items.

INPUT/ INSERT (I)

Inputs/inserts a new formatted selection criteria set.

AND

Inserts an ANDed subset of selection criteria (the set counter displays “AND Set 1.2 of 1”) after (default) or before the current criteria.

LEFT (L)

Positions the display to the previous criteria. Synonym for BACK.

LOCATE (LOC)

Scrolls directly to the specified record layout line.

LR (Locate Record)

Positions the display to the specified criteria number.

OCCURS (OCC)

Controls the display of array declaration items.

ON

Displays an array definition line for each subscripted item in a record layout.

OFF

Does not display an array definition line.  

ALL

Displays all occurrences separately with the subscript(s) and any criteria entered on a specific occurrence will only be applied to that occurrence. This additional parameter is only valid during Formatted Selection Criteria creation.

ANY

Displays a single entry for the occurrences and any criteria entered for the ANY occurrence will be applied to all occurrences. The record will meet the Selection Criteria if any of the occurrences meet the specified criteria. This additional parameter is only valid during Formatted Selection Criteria creation. ANY is applied for initial display of Selection Criteria.

Important

When applying 2 or more criteria in the same subset, all have to be true in the same occurrence to be selected.

When entered individually in different subsets, they don’t have to be true in the same occurrence to be selected.

EVERY

Displays a single entry for the occurrences and any criteria entered for the EVERY occurrence will be applied to all occurrences. The record will meet the Selection Criteria if all of the occurrences meet the specified criteria. This additional parameter is only valid during Formatted Selection Criteria creation.

Guidelines

  • Use the PROFILE command to display the current OCCURS ON or OFF value. Only ON or OFF are saved in the profile.
  • The OCCURS line contains the name of the array followed by the word OCCURS and the subscript bounds in standard COBOL format. If any of the subscripts are defined by a REFER clause, additional lines that follow the ARRAY line describe each REFER variable.
  • ANY, EVERY and ALL are available only in Formatted Selection Criteria.
  • ANY, EVERY or ALL is applied per set or subset if any. Each set or subset may have a different array setting.
  • You cannot switch ANY, EVERY or ALL to another if the criteria is specified on any occurrence field in a single set or single subset.
  • In ANY or EVERY mode, the SHOW OFFSET command shows the offsets of the first occurrence.

OFFSET

Displays field offsets.

OPT (O, 1)

Displays the Selection Criteria Options screen.

PROFILE (PROF)

Displays profile information lines.

REFLNG

Controls the display of BIT/CHAR REFER field length reference lines for PL/I data.

REPEAT (R) 

Causes a formatted selection criteria set, including any subsets, to be repeated (SET 3 of 3 increments to SET 4 of 4; AND SET 3.2 of 3 increases to AND SET 4.2 of 4).

AND

Repeats an ANDed subset of selection criteria. (the set counter displays “AND Set 1.2 of 1”) after the current criteria.

RETURN

Returns to the Primary Option Menu.

RIGHT

Positions the display to the next criteria. Synonym for FORWARD.

SHOW (SH)

Displays LEVEL, NUMBER, FORMAT, OFFSET, or PICTURE information for the selection fields.

SYNC

Controls the display of the SYNC term for fields in a COBOL record layout.

UP

Scrolls up.

USE

Specifies another record layout for the current formatted selection criteria.

VIEW (V)

Displays the View Criteria screen which is a keyword summary of the current settings for options, formatted, and unformatted selection criteria. See View Criteria Screen.

ZERO (Z)

Controls the display of leading zeros in the numeric

Selection Criteria Considerations When Data Fields May Be Nonexistent

When defining selection criteria with reference to fields where data might not exist in some records, File-AID/RDX does not exclude those records from the selection test.

A positive selection operator, such as EQ (equal to), indicates to select the record for processing if the condition is true.

A negative selection operator, such as NE (not equal to), indicates to select the record for processing if the condition is false.

Therefore, when using a negative selection operator, File-AID/RDX can select records that don’t have data in those fields.

A typical case of this is seen with fields that are specified in a record layout with OCCURS DEPENDING ON. Some records may have several occurrences of the field, while other records may have only one or none.

For example, consider a record layout called CUSTOMER, having a field called BALANCE defined with up to 12 occurrences, one per month, depending on another field, called DURATION-OF-ACCOUNT. The 12th occurrence will not exist for customers who have had accounts with the company for less than a year.

Example:

Assume you have the following 3 records in your file:

Alice Alvarez has been a customer for 5 months and had monthly balances of 1000, 2000, 3000, 500, and 0.

Bruce Bandler has been a customer for 3 months and had monthly balances of 1000, 2000, and 3000.

Carlos Cramer has been a customer for 5 months and had monthly balances of 1000, 2000, 3000, 0, and 0.

The records look like this:

Alice Alvarez,05,1000,2000,3000,500,0
Bruce Bandler,03,1000,2000,3000
Carlos Cramer,05,1000,2000,3000,0,0

You specify: Select all records with BALANCE(4) NOT EQUAL TO 500

This is interpreted to mean: Select all records NOT having BALANCE(4) = 500

Records with nonexistent data in occurrence 4 will be included in the selection, and you get these records:

Bruce Bandler,03,1000,2000,3000
Carlos Cramer,05,1000,2000,3000,0,0

Since Bruce Bandler does not have a balance for month 4, he does not have a balance that equals 500, and his record is selected as being not equal to 500.

If you want to ensure that only one record is selected, include the DURATION-OF-ACCOUNT variable in the selection criteria:

Specify: Select all records with DURATION-OF-ACCOUNT >= 5 AND BALANCE(4) NOT EQUAL TO 500

This would ensure that records with nonexistent data for the fourth occurrence would not be considered for selection. You would get only one record:

Carlos Cramer,05,1000,2000,3000,0,0

Selection Criteria Considerations: Using GT, LT, and BT with Arrays

For a data item that is not part of an array, specifying BETWEEN (BT) has the effect of selecting all records where that data item is both Greater Than or Equal to the specified lower bound, AND simultaneously Less Than or Equal to the specified upper bound. If you specify instead a pair of conditions, Greater Than (GT) a lower bound, AND Less Than (LT) an upper bound, a data item must meet both criteria in order to be selected. So for individual data items the effect is similar.

When Selecting data from arrays, the BETWEEN operator behaves the same way as it does for individual data items. Use the BETWEEN (BT) operator when you want to select only records containing data items that are simultaneously Greater Than or Equal to a specified lower bound and Less Than or Equal to a specified upper bound.

However, when selecting data in arrays, do not try to select a set BETWEEN specified bounds by specifying a combination of GT and LT.

When you specify GT and LT together for an array, you are really selecting two subsets:  All records having data items Less Than (LT) your upper bound AND all records having data items Greater Than (GT) your lower bound. Generally this will include many more records than the set between the two bounds.

Examples

Assume you have the following data records, containing an array with 5 occurrences of a 2-byte numeric field:

Record 1:  05,05,05,05,05
Record 2:  02,04,06,08,10
Record 3:  11,12,13,14,15

If you specify ANY with values BETWEEN 04 and 06, Records 1 and 2 will be selected.

If you specify ANY with values Greater Than 03 AND Less Than 07, all 3 records will be selected. The first 2 records have data items with values Less Than 07, and all 3 records have data items with values Greater Than 03.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*