Using selection criteria with formatted change criteria
Records and members can be processed selectively based on formatted selection criteria that is attached to your change criteria. The Selection Criteria screen, shown in the below figure, is displayed when you enter the SELECT (SEL) primary command on any Formatted Change Criteria screen. Formatted selection criteria enables you to change records based on specific field values displayed with a record layout or XREF (record layout cross reference). Data Solutions uses the same record layout or XREF for formatted aging or field exit criteria as it does for selection criteria.
Formatted Selection Criteria Screen
-------------------------------------------------------------------------------
File-AID/Data Solutions --- Formatted Selection Criteria ----------------------
COMMAND ===> SCROLL ===> CSR
SET 1 OF 1 EMPLOYEE-MASTER-FILE GBL = N
---- FIELD NUMBER/NAME ------ -FORMAT- RO ----+----1----+----2----+----3----+--
******************************* TOP OF DATA ***********************************
1 EMP-NUMBER 5/AN
2 EMP-LAST-NAME 15/AN
3 EMP-FIRST-NAME 10/AN
4 EMP-MID-INIT 1/AN
5 FILLER 2/AN
6 EMP-TITLE 30/AN
7 EMP-PERSONAL-INFO 23/GRP
8 EMP-NATL-ID-NUMBER 9/NUM
9 FILLER 1/AN
10 EMP-DATE-OF-BIRTH 6/AN
11 EMP-DOB-REDEF REDEFINES EMP-DATE-OF-BIRTH
11 EMP-DOB-REDEF 6/GRP
12 EMP-DOB-MM 2/NUM
13 EMP-DOB-DD 2/NUM
Valid RO: EQ,NE,GT,GE,LT,LE,CO,NC,BT,NB,VA,NV,VU,NU,MX,NO,FM,FF
Commands: CHG, GBL, View
Field descriptions
RO
Specify a relational operator. Possible values are:
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 character, text, numeric or packed data based on the field format. |
NV | Not valid character, text, numeric or packed data based on the field format. |
VU | Valid unsigned display numeric data based on the specified data type where the last digit must not contain a sign. VU operator will treat character and text as numeric. For a numeric data type, you must specify a length. VU cannot be used on packed data. |
NU | Not valid unsigned display numeric data based on the specified data type where the last digit must not contain a sign. NU operator will treat character and text as numeric. For a numeric data type, you must specify a length. NU cannot be used on packed data. |
FM | Field mask. For more information, see Field Mask. |
FF | Field-to-Field operation. For more information, see Field-to-Field Criteria. |
DF | Disguise failed. Change criteria in the specified set is to be processed, if the preceding non-data translation set failed. Not valid on a subscripted field. If disguise failed on a subscripted field, type DF in the RO column next to any field other than a subscripted field.Use like TF for non-data translation; For an example of how to use TF, see Defining Your Third Criteria Set. |
TF | Translation failed. Change criteria in the specified set is to be processed, if the preceding data translation set failed to find a search or key value. Not valid on a subscripted field. If disguise failed on a subscripted field, type TF in the RO column next to any field other than a subscripted field. For an example of how to use TF, see Defining Your Third Criteria Set. |
data value
For fields with relational operators other than BT and NB, you specify the field value to use in the comparison in alphanumeric format and File-AID/Data Solutions converts it to the correct data type format (as in File-AID/MVS Edit formatted mode). 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.
Only one set of selection criteria may be entered for a set of change criteria. When a second set of selection criteria is needed, another set of change criteria must be entered.
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. Multiple fields for a selection criteria are logically ANDed together.
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/Data Solutions 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 character, text, packed decimal, and zoned decimal fields. VA and NV operators will treat character and text as numeric.
The VU and NU operators can be used for character, and text fields. VU and NU operators will treat character and text as numeric.
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/Data Solutions 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/Data Solutions 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/Data Solutions removes any leading or trailing shift characters unless the value is enclosed in double quotes.
Sample Selection Set
Selection Criteria Example
COMMAND ===> SCROLL ===>
SET 1 OF 1 SAMP-FILE LAYOUT LENGTH:
---- 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 ***************************
The +conditions specified in the above figure translate into the following expression:
If ((A or B or C) and D)
which can also be stated as:
If (A and D) or (B and D) or (C and D) .
Primary commands
The following is a list of the primary commands that are valid on the 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.
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.
CHANGE (CHG or C)
switch from the Selection Criteria to the Change Criteria panels. This command is only valid on the Record Layout Selection Criteria and Global Selection Criteria panels.
COMPLEX (CMPLX)
Controls display of COMPLEX terms for PL/I data.
DELETE (DEL)
Deletes a criteria set (change and associated selection criteria)
DISPLAY (DIS)
Specifies a display format.
DOWN
Scrolls down.
END
Terminates display of the Selection Criteria screen and returns to the formatted change criteria screen.
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.
GLOBAL (GBL)
Displays the GLOBAL Selection Criteria panel which shows the defined global fields (variables). Use this panel to create criteria which will test values of global fields. Valid only if a global field has been defined.
On the GLOBAL Selection Criteria panel, you enter selection criteria in the same way you enter selection criteria on the record layout; the normal relational operators are available to operate against the global variables.
INPUT/ INSERT (I)
Inputs/inserts a new criteria set (formatted change and associated selection criteria.
LEFT
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.
MESSAGE (MSG)
Controls the message display.
OCCURS (OCC)
Controls the display of array declaration items.
OFFSET
Controls format of SHOW OFFSET (Columns, Relative, or Hex).
PICTURE
Controls the display of the PICTURE or DISPLAY line for numeric data.
PROFILE (PROF)
Displays profile information lines.
REDEFINE (REDEF, REF)
Controls the display of data item redefinitions.
REFLNG
Controls the display of BIT/CHAR REFER field length reference lines for PL/I data.
REPEAT (R)
Causes a criteria set (formatted change and selection) to be repeated.
RESET (RES)
Causes excluded lines to be redisplayed.
RETURN
Returns to the Primary Option Menu.
RIGHT
Positions the display to the next criteria. Synonym for FORWARD.
SHOW (S)
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.
VIEW (V)
Displays the View Criteria screen which is a keyword summary of the current settings for formatted change and selection criteria. See View Specification Keywords Screen.
ZERO (Z)
Controls the display of leading zeros in the numeric data fields.