Page 1 of 1

unit&vol

PostPosted: Mon Jun 14, 2010 10:29 am
by kakes
how to get the unit & vol ser of dataset which is allocated

Re: unit&vol

PostPosted: Mon Jun 14, 2010 11:34 am
by steve-myers
The volume serial is fairly easy, at least for Assembler programmers. Once the data set is open, locate a control block called the DEB. Use DCBDEBAD to get its address. The DEB is a complicated control area; it has a prefix at a lower storage address than what you get from DCBDEBAD, a basic section, and a device dependent section that starts after the basic section. The first 4 bytes of the device dependent section point to a UCB. The volume serial for tapes and disks is in UCBVOLI.

For disks, before the data set is opened, you can get the volume serial from the JFCB.

The unit is more complicated, and it depends on what you mean by "unit." If you want the binary device address, its in the 2 bytes at UCBCHAN. The old 3 byte UCBNAME field is not reliable any more; don't use it, though it would be preferred for systems before MVS/XA. Getting the device type, like '3390', for example, is quite complicated. It depends on the MVS system you're running, and it has changed quite a bit over the last 40 years. This is beyond the scope of this forum.

Re: unit&vol

PostPosted: Mon Jun 14, 2010 11:37 pm
by dick scherrer
Hello,

What does "get" mean for your question?

One easy to "get" this info is from 3.4.

If you more cleary explain what you are trying to "get", someone may have a suggestion.