Previous Topic: $FINALID FunctionNext Topic: $HEXTOCHAR Function


$FIXEDMASK Function (CA Datacom/DB Native Access)

$FIXED‑MASK (or $FIX‑MASK) in a SET statement to assign a character to use as a mask character when a where‑condition in a FOR construct for a CA Datacom/DB native access dataview uses a CONTAINS or NOT CONTAINS operator.

A mask character blanks out one character in an expression. You can use the mask character any number of times in the expression so that a search can be made for other characters in the expression, regardless of context.

This function has the following format:

$FIXED‑MASK

or

$FIX‑MASK 

Examples

Assume a six‑character alphanumeric field called FIELDA and a mask character that was allowed to default to * (asterisk). A conditional expression that contains the following clause searches for values of field FIELDA that have an A in position 2 and a BC in positions 4 and 5 respectively, regardless of what characters are present in positions 1, 3, and 6:

WHERE FIELDA CONTAINS '*A*BC*'

Assume a six‑character alphanumeric field called FIELDB and a mask character that was set to _ (underscore). A conditional expression that contains the following clause searches for values of FIELDB that have AB in positions 2 and 3, 3 and 4, or 4 and 5:

WHERE FIELDB CONTAINS '_AB_'

Assume a five‑character field called FIELDC with a value of ABCDE and a mask character set to #. For the following test, the results are as shown in the following table:

WHERE FIELDC CONTAINS compare‑string

Compare‑string

Result

'A#C#E'

True

'#ABC#'

False

'##BC#'

False

'CDE'

True

'B#C'

False

'#CD'

True

'#AB'

False

'DE#'

False