This general macro scans a specified field from left to right to detect the
presence of either an alphabetic character (A-Z) or a nonalphabetic
character, stopping when the requested character set is found. The
Translate and Test (TRT) instruction is used, limiting the size of the field
scanned to a maximum of 256 bytes.
After a successful scan for an alphabetic character, the alpha group
number, used for passenger names in airline reservation systems is given in
R2. (An alpha group is a set of alphabetic characters. The
entire alphabet is divided into a series of mutually exclusive alpha
groups.)
Format
- label
- A symbolic name can be assigned to the macro statement.
- STOP
- This parameter has two possible values:
- YES
- This causes a scan to stop on the first alphabetic character
detected. This is the default.
- NOT
- This causes a scan to stop on the first nonalphabetic character
detected.
- MAX
- This parameter has either a numeric or symbolic value.
- (literal)
- A decimal number equal to or less than 256, which defines the number of
bytes to be scanned from the address in R1.
- (symbol1)
- The symbolic address of a general register containing the number of bytes
minus 1 (-1) to be scanned from the address in R1. The contents must be
less than 256.
Entry Requirements
- R9 must contain the address of the ECB being processed.
- R1 must contain the address of the first byte of the field to be
scanned.
- R2 must be available for use by the macro. It can also be used to
supply the size of the field to be scanned.
- The global fields must be defined and an application register (other than
R1, R2) must be loaded with the global area base address by the GLOBZ
macro.
Return Conditions
- Control is returned to the next sequential instruction.
- The condition code can be changed by this macro. If it is nonzero,
the scan specified was successful.
- If the condition code is nonzero, the address of the byte that satisfied
the scan is provided. If the system has 16Mb or less of main storage,
the address is returned in the low order 24 bits of R1. The high order
8 bits of R1 are unchanged. If the system has more than 16Mb of main
storage, all 4 bytes contain the address.
- The high order 24 bits of R2 are unchanged by this macro.
- If the scan was successful, and if the option STOP=YES was specified or
implied, the low order 8 bits of R2 contain the alpha group number of the
character found expressed in binary format.
- If the scan was successful, and if the option STOP=NOT was specified, the
low order 8 bits of R2 contain the value of one if the nonalphabetic character
found was numeric (0-9) or a value greater than 1 if a special
character was found. The value is expressed as a binary number.
Programming Considerations
Do not use R0 because it is used in the EX instruction.
Examples
None.