MATCH

Compares a field to a list of key values and if a match is found, prints the corresponding string at the specified line and column.

If the match_text contains white space, it must be enclosed in single quotes (').

Any number of match text(s) can be tested, but each must have its own line, column, and print_text.

If a match is not found, the unmatched field is printed at the position specified in the parentheses.

Line and column positions for each matched string are treated as fixed or relative positions depending on the type of positioning used in the position qualifier for the PRINT command.

Syntax

MATCH match_text {line_num_lit|_var|_col} 

{column_num_lit|_var|_col} print_text...

For example:

print  &type_buyer  (20,12)  match
	A 20 12 Casual
	B 20 22 Impulsive
	C 21 12 Informed
	D 21 22 Choosey

To use relative line and fixed column positioning, you could enter:

print  $state  (0,25)  match
	OH 0 25 Ohio
	MI 0 37 Michigan
	NY 0 25 'New York'

The column positions are treated as fixed locations due to the fixed “25” position declared in parentheses.