Format | Decimal | Hexadecimal | Character | Binary (bit pattern) |
Year Constant |
---|---|---|---|---|---|
AC | X | X | |||
AQ | X | X | |||
ASL | X | ||||
AST | X | ||||
BI | X* | X | X | X | |
CH | X | X | |||
CLO/OL | X | ||||
CSF/FS | X | ||||
CSL/LS | X | ||||
CST/TS | X | ||||
CTO/OT | X | ||||
FI | X** | ||||
PD | X | ||||
PD0 | X | ||||
SS | X | X | |||
Y2B | X | X | |||
Y2C/Y2Z | X | X | |||
Y2D | X | X | |||
Y2P | X | X | |||
Y2S | X | X | |||
Y2T*** | X | X | |||
Y2U*** | X | X | |||
Y2V*** | X | X | |||
Y2W*** | X | X | |||
Y2X*** | X | X | |||
Y2Y*** | X | X | |||
SFF | X | ||||
UFF | X | ||||
ZD | X | ||||
Note:
* The decimal constant cannot be higher than 18446744073709551615 or lower than 0. ** The decimal constant cannot be higher than 9223372036854775807 or lower than -9223372036854775808. *** Full-Date formats |
Binary string | B'00000000' |
Character string | X'40' |
Hexadecimal string | X'00' |
Decimal fields | Zeros of proper format. Decimal constants for 2-digit year formats are padded or truncated to two decimal digits representing a year. The year constant will then have CENTWIN processing applied to it for comparison to a Y2 field. These are only for the two digit year fields, not for full date constants. |
The constants for PD0 comparison should not include the first digit and trailing sign of the PD0 data that will be ignored. Thus, a PD0 field of n bytes will be compared to a constant of n-1 bytes.
Current Date Constant Specification
You can compare fields to the date of an MFX run or the date of the run with an offset in addition to decimal fields and binary, character, and hexadecimal strings. Thus, records can more easily be included or omitted based on whether their dates are equal to, less than, or greater than the run date or the run date with an offset.
current date constant | Specifies a form of one of the &DATEx, &DATEx(c), &DATExP, or Y'DATEx' parameters where x is 1, 2, 3, 4 or 5 and depends on date comparison compatibility. |
+ | Specifies a date after the current date. |
– | Specifies a date before the current date. |
nnnn | Specifies the number of offset days or offset months depending upon x in the following cases: when the x in &DATEx, &DATEx(c), &DATExP, or Y'DATEx' is 1, 3, 4 or 5, ‘nnnn’ represents offset days and can be from 0-9999; when the x in &DATEx, &DATEx(c), &DATExP, or Y'DATEx' is 2, ‘nnnn’ represents offset months and can be from 0-999. |
For an example of an INCLUDE control statement that uses a date range based on a date constant, see figure Sample INCLUDE Control Statement Using Current Date Constant and Current Date With an Offset Comparison.
&DATEx and &DATEx(c) represent the current date as a character string (C'string') to which a field can be compared.
&DATExP represents the current date as a decimal number (+n) to which a field can be compared.
Y'DATEx' represents the current date with a Y constant (Y'string') to which a field can be compared.
|
Full-Date Format Constant Specifications
Constants used for full-date comparisons should have the same number of digits in the constant as in the full-date field that has been specified. Leading zeros must be specified when needed. The constant is constructed from two items; the first is a 2-digit year and the second is a value representing the months or days that comprise the remainder of the full date format. For example, if a 5-byte Y2W field were to be compared for a value greater than the 20th day of 1996, 96020 should be the code for the constant.
Constants can be coded to represent special values, such as those found in header or trailer records. All zeros or nines may be used with Y2T, Y2U, Y2V, Y2W, Y2X, and Y2Y. The same number of digits must be present as in the field that is being compared. The constant string Y'LOW' (representing binary zeros), Y'HIGH' (representing binary ones), or Y'BLANKS' (representing blanks) may be coded with the fields Y2T, Y2W, and Y2S. Y'DATEx' (representing the current date) may be coded with certain full-date formats specifically (see Full-Date Comparisons).
|
Substring Comparisons
Match occurrence of a constant within a record field
Match occurrence of a record field within a constant
Match occurrence of a pattern (wildcard) constant within a record field
In the first form, the length of the constant is less than the length of a specified field. Records will be searched for the occurrence of the constant anywhere within the field. The condition will be true if an EQ operator is specified and the constant is found or if a NE operator was specified and the constant is not found. For example, consider the constant “ANYTOWN” and a 60-byte field that contains an address. Records will be searched for the occurrence of the literal “ANYTOWN” anywhere within the 60-byte address field. If a match is found and the logical operator is EQ, then the logical result is “true.” The logical result is also “true” if the literal does not appear within the 60 bytes and the logical operator is NE.
In the second form, the length of a constant is greater than or equal to the length of a specified field. Records will be searched for an occurrence of the field within the constant. For example, the constant 'A02,A05,A06,A09' can be compared against the contents of a 3-byte field within the record. This constant is composed of four 3-byte substrings in a format that is known to match the data in the record field, separated by commas, a character known not to be in the record field. This means that ‘A02’, ‘A05’, ‘A06’, and ‘A09’ are the only possible 3-byte strings that could possibly match the data in the record field. If the 3-byte field matches any 3-byte character string in the constant, the logical result is “true” if the logical operator is EQ. If the 3-byte field does not match all 3-byte character strings in the constant, the logical result is “true” if the logical operator is NE.
The character used to separate elements of the constant should be a character that does not appear in the field being compared. The comparison is then equivalent to a standard comparison with ORed conditions when the logical operator is EQ. That is, the condition is true if 'A02' OR 'A05' OR 'A06' OR 'A09' is found in the field being compared. The substring comparison is a much more compact expression than multiple OR conditions in a standard comparison. When the logical operator is NE, the comparison is equivalent to a standard comparison with ANDed conditions.
In the third form, a pattern constant is used to describe a string that is the object of the search rather than the exact characters to be found. The pattern constant can consist of one or more character or hexadecimal constants and wildcard characters. A wildcard can be either a percent sign ‘%’ which matches any single character or an asterisk ‘*’ which can match zero or more characters in a string.
In this form of searching, only an occurrence of a pattern constant within a record field can be performed. An occurrence of a record field cannot be searched for in a pattern constant.
Typically this form of substring search is used when the beginning and ending characters of a field contain the major values of the search. The middle characters represent a range of values within this major category that are desired for selection.
For all forms of substring comparison, fields in the record can be from 1 to 32752 bytes in length. Constants can be in either character or hexadecimal format and can be from 1 to 256 bytes in length. (See the description of constants just after Permissible Field-to-Constant Comparisons.)
See examples starting with the figure Sample INCLUDE Control Statement Using Substring Comparison for some samples of how to use the substring comparison.
NUM Subparameter
|
See figure Sample OMIT Control Statement Using NUM for an example of how to use the NUM subparameter.