Unformatted XREF Definition
The following figure enables you to define conditions for selecting a record layout without using a record layout to define the fields.
Each line lets you specify criteria for record data at a position within the record relative to either the beginning of the record for a BASE layout or relative to the end of the currently displayed layout for a SEGMENT layout. The criteria includes a Relationship (RO) to some specified Data Value.
A record layout member is selected for formatting a record based on the unformatted field criteria on the screen. Criteria is grouped in sets based on your usage of the AND/OR connector.
Each OR begins a new criteria set. An AND continues the current set and lets you test for additional conditions in the current record. As soon as any field criteria set matches a record, the layout member displayed in the top area of this screen is selected and used to format the current data record. All other sets are bypassed. When a record fails to match a set, File-AID continues to test the record against any other specified sets. When all unformatted or formatted criteria sets for all members fail to match the record, the DEFAULT BASE layout is selected.
Unformatted XREF Definition screen
Field Descriptions
Cmd
Specify one of the following valid line commands to edit your selections:
A - Marks the destination after which a line is placed.
B - Marks the destination before which a line is placed.
C - Copy the line to a marked destination.
D - Delete the line. Dnn deletes the specified number of lines.
I - Insert a line. Inn inserts the specified number of lines.
M - Move the line to a marked destination.
R - Repeat the line. Rnn repeats the line the specified number of times.
AND/OR
Specify the AND/OR parameter to define multiple condition testing. It defines the logic to use to connect multiple conditions.
File-AID considers the OR connector the beginning of a new set of selections. AND continues a logical set of selections.
When evaluating ANDed conditions, all the conditions must be true. When evaluating ORed conditions, only one of the conditions must be true.
For example, if you specify: Selection 1 AND Selection 2 OR Selection 3, File-AID evaluates it as: (Selection 1 AND Selection 2) OR Selection 3.
Use File-AID option 0.2 System Parameters to set the default for the AND/OR field.
Position
For BASE layouts, position represents the starting data byte location of the record type field to be examined. A position of 1 represents the first byte of record data.
A value like +n where n is a number of bytes relative to the first byte of data following the currently selected layout is usually not needed since n without the plus indicates a byte location within the next segment. Positions +0 and 1 are the same location in the next segment of record data following the currently selected layout.
If selection of a SEGMENT is based on data values in the BASE, a special Position entry is supported: *n (asterisk "n") - where "n" is the actual position in the data record. *1 represents the first byte of record data.
Also supported is a notation like -n where n is the number of bytes prior to the end of the currently selected layout. This usage is provided when the identification of the next SEGMENT is located within the data area of the current SEGMENT or the BASE. -1 represents the last data byte in the currently selected layout.
Length
(Optional) Specify the field length. The Length field may usually be left blank. File-AID determines the length of your field based on the Data Value entered.
When data type is P (packed), Length is optional because File-AID automatically determines the size of the packed field at the Position specified. Field size may vary from record to record, but there must be a valid packed field at the specified Position IN EVERY RECORD or an error will occur.
If you specify a Length larger than the length of your Data Value, File-AID pads the data value with trailing blanks for data types T (Text), C (Character) and X (Hex). For data types P (packed), N (Numeric) and B (Binary) leading zeros are assumed when a length is specified.
RO
Specify a relational operator. The relational Operator is used with Position, Length, and Data Value to set up a conditional test for File-AID to perform. File-AID is distributed with a default value of EQ (equal) for relational operator. Use File-AID 0.2 Selection Criteria Parameters screen to set your own default. Valid values are:
BT | Between; the value is greater than or equal to the first endpoint and less than or equal to the last endpoint. |
EQ, = | Equal to |
GE, > = | Greater than or equal to |
GT, > | Greater than |
LE, < = | Less than or equal to |
LT, < | Less than |
MX | Bits are mixed, ones and zeros (Mask data value only). |
NB | Not between; the value is less than the first endpoint or greater than the last endpoint. |
NE, ¬ =, ! = | Not equal to |
NO | Bits are not ones (Mask data value only). |
Data Value
Specify the data string, up to 52 bytes, for which File-AID is to validate. If a data type is specified, the data string must be enclosed in single (’ ’) or double (" ") quotes. When a data type is not specified, alphanumeric text (T) is assumed.
The following table describes valid data types for this field:
Data Types
Data Type | Type Description | Example | Description of Data |
---|---|---|---|
B | Binary | B’+147,-25,+1117’ | Binary equivalent of decimal number specified in quotes. In this example using the default of fullword, File-AID searches for 00000093, FFFFFFE7, or 0000045D. File-AID assumes the length of 4 or you can specify 1, 2, 4, or 8. Note: If the binary data in the record contains a sign, all data values must also contain a sign (+/-). |
C | Character | C’Smith’ | Case-sensitive character value of uppercase S and lowercase mith. |
X | Hexadecimal | X’0001FF’ | Hexadecimal value 0001FF. |
M | Mask (Use with bit relational operators) | M’11000000’ or M’C0’ | The mask can be specified in binary or hexadecimal to indicate which bits File-AID should examine. This example tests the first two bits of the specified byte. |
N | Numeric | N’25’ | Positive or unsigned numeric value +25 or 25. |
P | Packed | P’12345’ | Positive or unsigned packed value. |
T | Text | T’smith’ | Alphanumeric text, not case-sensitive. Value smith, SMITH, or any combination of upper and lowercase characters. T (text) is the default data type. |
Use the END command (PF3) to save your unformatted entries and return to the Define XREF screen. The CANCEL command exits the Unformatted XREF Definition screen without saving your entries and returns to the Define XREF screen.
Example
TEST RECORD FOR "Q" IN 1 AND X'00' OR X'40' IN 10
The ORDERWO record layout member, using the data structure beginning with data name INTERNAL-WORK-ORDER, is used to format records containing a character Q in position 1 and either a hex ’00’ or hex ’40’ in position 10.
Guidelines
The Data Value area is where you describe the data condition you are looking to find when determining which layout to use to format a record. The data in each record is compared to your Data Value to see if the record meets your criteria for layout selection.
The Position and RO (Relational Operators) define the location of the record data and the comparison condition.
- Entries and line commands specified in the Cmd field are processed before primary commands.
- Any errors detected must be resolved before continuing.
- Scrolling DOWN and UP is supported.
- The number of entries is unlimited.
Pressing Enter causes line command interpretation and validation of your entries. Some fields are changed by File-AID during validation to clarify your selection. This occurs when you enter character Data Values and File-AID marks your value as text (T’anycase’). Use C’x’ for explicit case. For example, type ABC in the Data value field and press Enter, File-AID redisplays the screen with T’ABC’ in the field. This text string test "abc" matches any combination of upper and lowercase. Changes due to validation and interpretation can also occur when you do not specify Length or Position.
BT (Between) and NB (Not between)
For relational operators BT and NB, you specify your Data Value as two values separated by a colon (:). The values may be hex strings, character strings, or numeric tests.
The BT relational operator includes the endpoints of the range you specify and the NB relational operator does not include the endpoints.
Data types P (Packed), B (binary), and N (Numeric) are also valid but both values must be the same type (Ex. P’-1:+100’ or N’10:20’ or B’-5:+1000’ but not P’1’:N’100’).
If you want to compare (EQ, NE, LT, GT, LE, GE only) a field to blanks (hex 40s) simply leave the Data Value field blank and enter the desired number of blanks for comparison in the Length field.
For all relational operators the Length must be in the range 1 to 30. Length plus the start Position must not exceed the record length.
For all relational operators, when Length exceeds the actual length of the entered Data Value, blanks are padded to the right of the Data Value. If the Length field is left blank, the default length is the actual length of the specified Data Value.
When defining Formatted XREF criteria the Position and Length values are automatically determined by the COBOL or PL/I data field definition.
Text Data (T)
Any data entered without a data identifier is considered to be text data. Text data is not case sensitive. It matches any case in search data. When a data identifier is used, text data is specified with the data identifier T. The actual text data follows the T and is enclosed in quotes.
DATA ===> SMITH
DATA ===> T'SMITH'
DATA ===> SMITH,JONES (ORed text data)
DATA ===> ",DSN=" (single entry)
Text data may be enclosed in either single quotes (’A’) or double quotes ("A"). When data is enclosed in single quotes (’A’), File-AID allows multiple data entries to be separated by commas and considers the multiple data entries to be ORed. For those times when you need to scan for commas or other special characters, File-AID accepts all data located between double quotes, including commas, single quotes, etc. as one single data string.
Packed Data (P)
Packed data is specified with the data identifier P. The actual number to be searched for follows this identifier and is enclosed in quotes.
DATA ===> P'12345'
DATA ===> P'1,2,3,4,5' (ORed data entry)
File-AID allows multiple packed data entries to be separated by commas and considers the multiple entries to be ORed. Packed data may be entered to a maximum of 31 digits, however, only significant digits need to be entered because File-AID computes the lengths of the packed fields in each record.
Packed data fields signed with F or C are considered numerically equal. Packed data can be signed by using a sign character (+,-) after the first quote.
DATA ===> P'+1' Signed C
DATA ===> P'-1' Signed D
DATA ===> P'1' Signed F
Example
In this example the layout is selected if the record contains a packed 0 or 50 at Position 15 AND also has a packed 100 at Position 25.
Hexadecimal Data (X)
Hexadecimal data is specified with the data identifier X. The actual hex data to be searched for follows this identifier and is enclosed in quotes. Hexadecimal data must be entered as one or more pairs of hex digits (0-9,A-F).
DATA ===> X'0001FF'
DATA ===> X'00,01,FF' (ORed HEX data entry)
DATA ===> X'789C,789D' (ORed HEX data entry)
File-AID allows multiple hexadecimal data entries to be separated by commas and considers the multiple entries to be ORed.
Character Data (C)
When searching for the exact case of character data, use the C data identifier. Entered lowercase characters are not converted to uppercase when the C data identifier is used to test file data. File data must match the exact case of the specified character string.
DATA ===> Smith (find any case)
DATA ===> T'Smith' (find any case)
DATA ===> C'Smith,Jones' (ORed explicit case character entries)
DATA ===> C"Smith,Jones" (single explicit case character entry)
Character data must be enclosed in either single quotes (’ ’) or double quotes (" "). When characters are enclosed in single quotes, File-AID allows multiple strings to be separated by commas and considers the multiple data entries to be ORed. For the times when you need to scan for commas or other special characters, File-AID accepts all data located between double quotes, including commas, or single quotes as one single data string.
Mask (M)
A mask for the data value is specified with the M data identifier. The mask indicates which bits to test in the specified byte. The mask can be entered as either:
- 2 hexadecimal characters
- 8 binary characters (all zeros and ones).
DATA ===> M'F1' (Hexadecimal mask)
DATA ===> M'11110001' (Binary mask)
File-AID does not allow multiple binary data entries.
Specialized relational operators (RO) are provided for use with mask data:
EQ
All bits specified as ones in mask are ones in the data.
MX
Of the bits specified, at least one is on (one) and one is off (zero).
NO
Of the bits specified as ones in mask at least one is off (zero) in the data.
NE
All bits specified as ones in mask are off (zeros) in the data.
Binary Data (B)
Binary data is specified with the data identifier B. The actual binary data to be searched for follows this identifier and is enclosed in quotes. Binary numbers must be specified as a string of decimal digits (0-9) with an optional leading sign (+ or -). File-AID converts your entered decimal number to its binary equivalent and performs the test you have specified. A leading - (minus) implies that the high-order bit is on. A leading + (plus) implies that the high-order bit is off.
The Length field (1, 2, 4, or 8 only) SHOULD BE SPECIFIED and is used to determine the length of the binary data to test. The default length is 4 if no length is specified.
DATA ===> B'64' hex X'00000040' (length 4)
DATA ===> B'-1,100' OR’d values -1 or 100
Numeric Data (N)
Numeric data is specified with the data identifier N. The actual number to search for follows this identifier and is enclosed in quotes. Numeric data is assumed to be "zoned" numeric (X'F0' through X'F9'). The last digit in the field may contain a plus (C zone) or minus (D zone). You may specify an optional leading sign in your Data Value For example, N'-456' is treated like X’F4F5D6’.
DATA ===> N'12345'
DATA ===> N'1,2,3,4,5' (ORed data entry)
File-AID allows multiple numeric data entries to be separated by commas and considers the multiple entries to be ORed. Numeric data may be entered to a maximum of 15 digits. However, only significant digits need to be entered because File-AID uses your specified Length and inserts leading zeros to test fields in each record. If Length is not specified, the number of digits entered is used as the field length.
Data Duplication
File-AID allows you to specify a duplication factor, which eliminates the need to code repetitive data. The duplication factor is a number from 1 through 255, which specifies the number of contiguous occurrences of the specified data value for which File-AID compares.
A duplication factor is allowed only with EQ, GE, GT, LE, LT, MX, and NO. It is ignored with the NE, CO, NC, BT, NB, E, and EA relational operators.
WITHOUT DUPLICATION WITH DUPLICATION
C'12121212' 4C'12'
X'000C000C' 2X’000C’
X'000C000C' 2P’+0’