Mask field

A mask field is a field with a mask that is based on a floating trigger. An INDEX parameter that is based on the mask field cannot include any other fields and must not create GROUPRANGE or PAGERANGE type indexes.

FIELDn={record,column,length,(TRIGGER=n,BASE=0 | TRIGGER,MASK='@ # = ¬ ^ %')}
The values are:
n
Specifies the field parameter identifier.
record
Specifies the relative record number from the trigger on which the field is based. This value is the record number where ACIF begins to search for the field. The supported range of values are ±0 to 255.
column
Specifies the relative column number from the BASE value. This value is the column number where ACIF begins to search for the field. A value of 1 refers to the first byte in the record. For files that contain carriage control characters, column one refers to the carriage control. For those applications that use a specific carriage control character to define page boundaries (for example, skip-to-channel 1), consider defining the value of the carriage control character as one of the TRIGGERn parameters. If you specify BASE=0, the column value can be 1 - 32756. If you specify BASE=TRIGGER, column value can be -32756 to 32756.
length
Specifies the number of contiguous bytes (characters) that compose this field. The supported range of values are 1 - 250. The field can extend outside the record length, if the column where it begins lies within the record length. In this case, ACIF adds padding blanks to complete the record.
TRIGGER=1 | n
Specifies the TRIGGERn parameter ACIF uses to locate the field. When you are using MASK, you must specify a trigger that is defined with TYPE=FLOAT.
BASE=0 | TRIGGER
Specifies whether ACIF uses the starting column number of the trigger string value to locate the field data. The values are:
0
ACIF adds zero to the field column offset. You can use 0 if the field data always starts in a specific column.
TRIGGER
ACIF adds the starting column number of the trigger string value to the field column offset. Use TRIGGER if the field data does not always start in a specific column, but is always offset a specific number of columns from the trigger string value. The trigger string value can begin in any column in the record. A field that is based on this trigger occurs in the trigger record.
REGEX='regular expression'
The regular expression that ACIF matches with data located in the field columns. The regular expression must be specified in the code page given by the CPGID parameter, and can be from 1 to 250 bytes in length. The regular expression can be specified in hexadecimal. You can specify either a mask or a regular expression, but not both.

When you specify the REGEX keyword, you must also specify the OFFSET keyword. When you define a transaction field that includes a regular expression, an INDEX parameter based on the field cannot reference any other fields. An INDEX parameter based on a transaction field that includes a regular expression must create grouprange or pagegrange indexes. Here are some examples of common regular expressions:

Account
Look for the characters Account. By default, searches are case sensitive.
[A-Z]
Look for one uppercase letter.
[A-Z] {3}
Look for three consecutive uppercase letters.
[0-9] {5}
Look for five consecutive digits.
[0-9]+
Look for one or more digits.
[^a-z]
Look for everything except lower case a to z.
\s
Look for one whitespace character (space, tab, etc).
\S
Look for any character not whitespace.

For example, the following definitions cause ACIF to search columns ten through seventeen for a hexadecimal 41 followed by four numeric characters (hexadecimal 30-39), a hexadecimal 2D, and two numeric characters (hexadecimal 30-39). The match must begin in the first column specified by the OFFSET parameter.

CPGID=850
FIELD3=*,*,8,(OFFSET=(10:17),REGEX=’A[0-9]{4}-[0-9]{2}’,ORDER=BYROW)

The field parameter in the following example causes ACIF to locate field values that begin in column 83 of the same record that contains the TRIGGER1 string value. The field length is 8 bytes. BASE=0 is specified because the field data always starts in the same column.

TRIGGER1=*,1,'1',(TYPE=GROUP)
FIELD1=0,83,8,(TRIGGER=1,BASE=0)

The field parameter in the following example causes ACIF to locate field values that begin 10 columns offset from the trigger string value. By basing the field on TRIGGER2 and specifying BASE=TRIGGER, ACIF can locate the field by adding 10 to the starting column offset of the trigger string value.

TRIGGER2=*,*,'ACCOUNT:',(TYPE=FLOAT)
FIELD2=0,10,12,(TRIGGER=2,BASE=TRIGGER)

MASK='@ # = ¬ ^ %'
Specifies the pattern of symbols that ACIF matches with data in the field columns. If the data matches the MASK, ACIF selects the field.
Note: You cannot specify MASK with a double-byte or Unicode code page (EXTENSIONS=IDXCPGID), unless you are using code page 1208 and only indexing single-byte characters. MASK does not support the multiple-byte characters of code page 1208 (UTF-8).

These mask symbols are valid:

@
Matches an alphabetic character.
#
Matches a numeric character.
=
Matches any character.
¬
Matches any non-blank character.
^
Matches any non-blank character.
%
Matches a blank character or numeric character.

In the following example. ACIF selects the field only if the data in the field columns contain numeric characters:

TRIGGER2=*,25,'SOURCE',(TYPE=FLOAT)
FIELD2=0,38,4,(TRIGGER=2,BASE=0,MASK='####',DEFAULT='4059099376')