Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
The SEARCH macro set HLASM Toolkit Feature User's Guide GC26-8710-10 |
|
The SEARCH macro set is provided to allow more complex loops to be coded. All of the operands noted above for DO loops may also be used on the STRTSRCH macro. The flowchart for the SEARCH macro set is:
┌─────────────────←───────────────────────────┐ ↓ ↑ not finished │ ┌────┴────┐ │ ┌───┐ ┌───────────┐ false ┌───┐ │test for │ ┌───┐ ──────→┴─→─┤ A ├─→─┤ EXITIF (x)├─→──────┤ C ├─→─┤end loop ├─→─┤ D ├─→─┬──→ STRTSRCH └───┘ └─────┬─────┘ └───┘ │condition│ └───┘ ↑ ↓ true ORELSE └─────────┘ ENDSRCH │ ┌──┴──┐ ENDLOOP │ │ B ├─────────────────────────────────────→───┘ └─────┘The general structure of the SEARCH macro set is: STRTSRCH (any DO-type loop operands) Process Code A EXITIF (any IF-type operands) Process Code B ORELSE Process Code C ENDLOOP Process Code D ENDSRCH Multiple EXITIFs are permissible. However, for each EXITIF, an ORELSE must appear at some point in the code before the next EXITIF. However, the last ORELSE (the one before the ENDLOOP macro) is optional. For example:
produces:
Another example:
produces:
|
Copyright IBM Corporation 1990, 2014
|