ShameemOracle
New User
Joined: 23 Sep 2009 Posts: 15 Location: bangalore
|
|
|
|
hi all,
Below piece of REXX uses ISPF service DSINFO to extract information on a Dataset and then uses custom panels to display the result.
Hope it will be useful.
Code: |
/*RExx*/
/* ************************************************************ */
/* Coded by : Shameem K Shoukath */
/* Date : 11-09-2009 */
/* */
/* Function: This REXX extracts Dataset information */
/* Using ISPF Service DSINFO */
/* */
/* Tested : Successfull on HFS,ZFS,PDS(FB VB,U),PDSE */
/* ************************************************************ */
SAY 'This program display information on given dataset'
say 'Enter your datasetname (Eg: SHAMEEM.REXX) :'
Pull DSNAME
if DSNAME =" " then /*DSNAME defaults if null value enters*/
do
say 'NULL value entered. DSNAME defaulted to SHAMEEM.REXX'
DSNAME=SHAMEEM.REXX
end
DSNAME="'"||DSNAME||"'" /*For dealing PREFIX */
result= sysdsn(DSNAME) /*Checks the Dataset exist or not*/
if result <> "OK" then
do
Say ' Dataset does not exist. Please provide a valid DS name'
return
end
/* -----------Get Dataset info--------------------------------*/
ZALRF=""
"ISPEXEC DSINFO DATASET("DSNAME")"
IF rc <> 0 THEN
do
Say 'Error in getting ds info: ' zerrmsg
exit
end
/* -----------------------------------------------------------*/
Say 'Do you prefer panel or REXX display (P/R)? default is R'
pull Choice
if (Choice ='P') then /* Populate Data 4 panel display */
do
Address 'ISPEXEC'
ZALVOL1='ZALVOL1'
zalspc = ZDSSPC /*Primary allocation units*/
zal2spc = ZDS2SPC /*Secondary space units*/
ZAL1EX = strip(zds1ex) /*Primary allocation */
ZAL2EX = strip(zds2ex) /* Secondary alloc*/
If ZDS#VOLS > 1 then
ZALVOL=zdsvtab /*Volume table for multivolume dataset*/
else
ZALVOL=zdsvol /* Volume name for single volume dataset*/
DSNS=dsname /* Name of dataset*/
ZALSC=ZDSSC /*Storage Class*/
ZALMC=ZDSMC
ZALDC=ZDSDC
TOTA=Strip(zdstota)
ZALVOLF='ZALVOLF'
DEVT=zdsdevt
DSORG=zdsorg /*DS Org*/
PAGEU=Strip(zdspagu)
PERCU=Strip(zdsperu)'%'
EXTA=Strip(zdsexta) /*Extends allocated*/
EXTU=Strip(zdsextu) /*Extends used*/
ZALRF=zdsrf /*Record format*/
ZALLREC=Strip(zdslrec) /*Lrecl*/
ZALBLK=zdsblk /*BLKSIZE*/
TOTU=strip(ZDSTOTU)
ZALDSNT=zdsdsnt /* DSN TYpe*/
IF ZDSXDATE= 0 THEN
EXDATE='**NONE**'
else
exdate=ZDSXDATE
CRDT= zdscdate
RDATE= zdsrdate
/* ----------------- Display the Panel --------------------------*/
if (zdsdsnt='LIBRARY' | zdsdsnt='HFS') then /*ISRUAISE Equivalent*/
'DISPLAY PANEL (DSINFOP1) RETBUFFR('bufname')
RETLGTH('R17057')'
ELSE /* equivalent of panel ISRUAIES */
'DISPLAY PANEL (DSINFOP2) RETBUFFR('bufname')
RETLGTH('R17057')'
/* ---------------------------------------------------------------*/
end
else
do
dts=copies('.',30)
hlines=copies('-',75)
spaces=copies(' ',8)
say left(spaces dts dts,60)
say left(spaces' Name of the Dataset:'dts,40) DSNAME
say left(spaces dts dts,60)
say left(spaces' 'hlines,66)
/* Start of Data population */
say left(spaces'| Created Date : 'ZDSCDATE spaces,35),
Left('| Volume : 'ZDSVOL,25) right('|',5)
say left(spaces'| Last Ref Date: 'ZDSRDATE spaces,35),
Left('| Unit : 'ZDSDEVT,25) right('|',5)
say left(spaces'| Expiry Date : 'ZDSXDATE spaces,35),
Left('| LRECLS : 'STRIP(ZDSLREC),25) right('|',5)
say left(spaces'| DataSet Type : 'ZDSDSNT spaces,35),
Left('| PRIMARY : 'STRIP(ZDS1EX) ZDSSPC,25) right('|',5)
say left(spaces'| STORCLASS : 'ZDSSC spaces,35),
Left('| SECONDAY : 'STRIP(ZDS2EX) ZDS2SPC,25) right('|',5)
say left(spaces'| DATACLASS : 'ZDSDC spaces,35),
Left('| Ds Org : 'ZDSORG,25) right('|',5)
say left(spaces'| MGMTCLASS : 'ZDSMC spaces,35),
Left('| RECFM : 'ZDSRF,25) right('|',5)
say left(spaces'| COMPRESSIBLE : 'ZDSSEQ spaces,35),
Left('| MEMBERS : 'STRIP(ZDS#MEM),25) right('|',5)
say left(spaces'| PAGE USED : 'STRIP(ZDSPAGU) spaces,35),
Left('| BLKSIZE : 'STRIP(ZDSBLK),25) right('|',5)
say left(spaces'| %USED(PDSE) : 'STRIP(ZDSPERU) spaces,35),
left('| EXTENDS : 'STRIP(ZDSEXTA)' ALLOCATED'spaces,35),
SAY Left(SPACES'| APF STATUS : 'ZDSAPF SPACES,35),
Left('| EXTENDS : 'STRIP(ZDSEXTU)' USED',25) right('|',5)
say left(spaces'| DIR BLOCK : 'STRIP(ZDSDIRA)' ALLOC' spaces,35),
Left('| LINKLIST : 'ZDSLNK,25) right('|',5)
say left(spaces'| DIR BLOCK : 'STRIP(ZDSDIRU)' USED' spaces,35),
Left('| DIR LIMIT: 'STRIP(ZDSDIR),25) right('|',5)
say left(spaces' 'hlines,66)
/* END of Data population */
end
return
exit
|
|
|