Scan to Delimiter - Zone Equal (SZE)/OP=18

Format

OP AF BF A Syllable B Syllable

OP = 18

AF is the length of the A field. A value of 00 is equal to a length of 100 units (digits or characters as specified by the A address controller). AF may be indirect or may indicate that the A syllable is a literal.
BF is the length of the B field. A value of 00 is equal to a length of 100 units (digits or characters as specified by the B address controller). BF may be indirect.

The A Syllable is the address of the delimiter list field. Address may be indexed, indirect or extended. The final address controller data type may be UN, SN or UA. An SN controller is treated as if it were a UN controller (i.e. 7SN == 7UN).
The B Syllable is the address of the data field to be scanned. Address may be indexed, indirect or extended. The final address controller data type may be UN, SN or UA. An SN controller is treated as if it were a UN controller (i.e. 7SN == 7UN).

Function

The Scan to Delimiter - Zone Equal instruction scans the B field for a character whose zone digit is equal to the zone digit of any of the delimiter characters from the A field.

The zone digit of the first B field character is compared to the zone digit of each delimiter (A) field character until a match is found. If no match is found, the next B field character's zone is compared to each delimiter's zone. Continue this process until a matching delimiter's zone is found or until the B field is exhausted.

If a numeric data type (UN/SN) is specified in either field add the EBCDIC zone digit F to each digit to form the character for use in the comparison.

This instruction stores the number of characters in the B data field preceeding the zone-equal character into memory locations 38-39, relative to Base #0 (accessible with indirect field length). However, if no zone-equal character is found, store the field length of the data field minus one (BF - 1).

Comparison Flags

Set the Comparison Flags to HIGH if none of the zones of any of the characters in the B field were found to be equal to the zone portion of any delimiter in the A field. Set the Comparison Flags to LOW if the first character's zone in the B field was equal to any delimiter's zone and set the Comparison Flags to EQUAL if any character's zone but the first was equal to any delimiter's zone.

Overlap

There are no overlap restrictions for this instruction.

Examples

Example (1) Scan Delimiter-Zone Equal, First zone equal

OP AFBF A Syllable B Syllable
18 0203 A Field (UA) B Field (UA)
                    BEFORE              AFTER
   A Field           C1D1             unchanged
   B Field         D2B6C1             unchanged
   000038             nn                  00
   Comparison Flags   nn                 LOW

Example (2) Scan Delimiter-Zone Equal, Other than first zone equal

OP AFBF A Syllable B Syllable
18 0204 A Field (UA) B Field (UA)
                    BEFORE              AFTER
   A Field           C1D1             unchanged
   B Field         E6D2C1D4           unchanged
   000038             nn                  01
   Comparison Flags   nn                 EQUAL
instructions/sze.txt · Last modified: 2008/11/25 12:06 by scott
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki