Invoking the UCB scan service

Each time that you invoke the UCB scan service, you will obtain the address of the common segment of one UCB. To scan several UCBs, you must invoke the UCB scan service repeatedly, once for each UCB. The UCB scan service keeps track of your position in the UCB chain by information that it stores in the 100-byte work area that you provide as input. To start your scan, clear this work area to binary zeroes. The zeroes indicate that the UCB scan service is to start the scan at the first UCB in the system or device class. If you want to continue the scan to obtain the next UCB, do not change the work area.

When you have obtained the address of a UCB common segment, you can use the UCBDEVN macro to convert the device number referred to by the UCB into a four-byte printable EBCDIC form.