gtpg2m3rGeneral Macros

SCANA-Scan Data Field

This general macro searches a data field for the presence of any specified characters. A match with one of these specified characters will result in a branch to a specified location, or an ENTNC to any specified program. The user specifies the field to be searched and up to 9 characters, which will be used for matching arguments.

Associated with each of the 9 possible characters to be searched for is an option relating to the performance of the macro when a match is found. The count of bytes may either include the character that caused the match, or it may not.

Format




label
A symbolic name can be assigned to the macro statement.

AT=symbol1|R1
The symbolic name of an application register other than R0 referring to the first byte of a data field to be scanned. R1 will be assumed if the parameter is omitted.

CHKn
Characters to be used for matching with bytes in the input field. Each CHK parameter must have a corresponding GOTO parameter. The CHK parameters may be any of the following:

NONUM
Any nonnumeric character (that is, not digits 0-9).

NUM
Any numeric character (that is, digits 0-9) will cause a match.

ALPHA
Any alpha character (that is, A-Z) will cause a match. Consider use of the ALPHA macro instead of this action.

ALPHAX
Any true alpha character (that is, A-Z, but excluding the nonalpha characters in the gap between EBCDIC I and J, and in the gap between EBCDIC R and S) will cause a match.

location
Any byte location that will, at macro execution time, contain a character to be used for matching.

Aterm
An A followed by any character or hexadecimal self-defining value that can be coded in a CLI instruction.

Examples are:

CHK1 = AC'B (defines a B character).

CHK1 = AX'1C' (defines a hexadecimal value of 1C).

COUNT=symbol2|R15
The symbolic name of an application register other than R0 which will contain, at completion of the macro, the number of bytes including the byte that caused the macro to stop scanning, or if OPTION is EXC, the number of bytes preceding the byte which caused the macro to stop scanning.

R15 is assumed if the parameter is omitted.

If parameter MAX is a 1, code manipulating this register is not included since there is no need for counting.

FALSE=symbol3
A symbolic location that will be branched to if no match is found within the data field. If omitted, control will be returned to the next sequential instruction (NSI).

GOTOn
An action to be performed if a match occurs for the CHK1...CHK9 characters. The GOTO parameters are defined as follows:

location
This is a location where the program branches if a match is found with the corresponding CHKn parameter. (The symbol must not start with a B).

Bprogram
This is a 4 character program name preceded by a B. The program is entered with no return on a match with the corresponding CHKn parameter.

MAX
The maximum number of bytes in the data field that are to be scanned or a reference to a register that contains the maximum. The default maximum is 256. The maximum for the MAX parameter is 65 536.

symbol4
A register containing the maximum number of bytes (meeting the requirements of literal1). If the maximum number of bytes is equal to 1, symbol2 will not be used, since there will be no need to keep a count of the number of bytes scanned.

literal1
Any number defined by the limits 1 <= literal1 <= 256. If equal to 1, COUNT parameter is ignored.

OPTION
Specify one of the following:

INC
Causes the count of bytes to include the character that caused the match.

EXC
Causes the count of bytes to exclude the character that caused the match.
  • The field to be scanned must be referenced by symbol1.
  • If the CHK parameter uses a symbolic location, that location must contain the character to be used in the match at execution time.

Entry Requirements

R9 must contain the address of the ECB being processed.

Return Conditions

Programming Considerations

Examples