/* REXX *** */ Parse ARG dsn If dsn = '' then Do Say 'You must specify a dsn parameter' Exit 4 End dsirc = LISTDSI(dsn 'NORECALL') Select /* handle the simple case */ When dsirc = 0 then DO Say 'Dsname='sysdsname' Volume='sysvolume' Unit='sysunit Say ' Primary='sysprimary' Secondary='sysseconds' Units='sysunits Say ' Allocated ='sysalloc' Used='sysused Say ' Extents='sysextents End /* handle the multiple volume case */ When dsirc = 4 & sysreason = 19 then DO Say 'LISTDSI returned RC='dsirc' Reason='sysreason Say Sysmsglvl2 Say ' ' x = OUTTRAP('ld.',,'NOCONCAT') Address TSO "LISTD '"sysdsname"'" units = sysunits /* remember units of allocation */ vols = 0 /* switch for LISTD command parsing */ vc = 0 /* volume count */ exts = 0 /* total extents */ alc = 0 /* total alloc */ Say 'Dsname='sysdsname Do i = 1 to ld.0 Select When vols then Do vc = vc + 1 vol=STRIP(ld.i) dsirc = LISTDSI(dsn 'VOLUME('vol')') If dsirc > 0 then Do Say 'Dsname='dsn' Volume='sysvolume' Unit='sysunit Say 'LISTDSI returned RC='dsirc' Reason='sysreason End Else Do Say 'Volume='sysvolume' Unit='sysunit' Extents='sysextents Say ' Primary='sysprimary' Secondary='sysseconds, 'Units='sysunits Say ' Allocated ='sysalloc' Used='sysused exts = exts + sysextents If sysunits == units then alc = alc + sysalloc Else Do alc = 'N/A' units = '' End End End /* look for list of volumes */ When Left(ld.i,5) = ' --VOL' then vols = 1 /* ignore everything else */ Otherwise Nop End End i Say ' ' Say vc' volumes found - Total extents = 'exts Say 'Total allocation = 'alc units x = OUTTRAP('OFF') End /* don't handle other cases */ Otherwise Do Say 'Dsname='dsn' Volume='sysvolume' Unit='sysunit Say 'LISTDSI returned RC='dsirc' Reason='sysreason Say Sysmsglvl2 Exit dsirc End End Exit 0