JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...


Postby kakes » Mon Jun 14, 2010 10:29 am

how to get the unit & vol ser of dataset which is allocated
Posts: 2
Joined: Mon Jun 14, 2010 10:04 am
Has thanked: 0 time
Been thanked: 0 time

Re: unit&vol


Re: unit&vol

Postby steve-myers » Mon Jun 14, 2010 11:34 am

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.
Global moderator
Posts: 1771
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 167 times

Re: unit&vol

Postby dick scherrer » Mon Jun 14, 2010 11:37 pm


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.
Hope this helps,
User avatar
dick scherrer
Global moderator
Posts: 6308
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 90 times

Return to JCL