datasetzos

How can I determine, programmatically, if a volume is available (online) on z/OS?


If I look in a dataset catalog and determine there is a dataset with a particular name on a particular volume, how can I then determine if that volume is 'online'?

For example, if I use the CSI (catalog search interface) to look for 'MY.DATASET', I can get the volume but how can I determine if the volume is online? I know I can issue various operator commands but I would like something programmatic (from C ideally, but assembler works) where I don't have to 'scrape' the output. For example, I could issue:

d u,dasd,online,,65536'

to see the online datasets but the output isn't intended to be programmed to I don't think.


Solution

  • Another option is to use the ucbscan macro - see this https://www.ibm.com/docs/en/zos/2.5.0?topic=wto-ucbscan-scan-ucbs