IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

REXX: display dataset info using ISPF Service DSINFO & p


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ShameemOracle

New User


Joined: 23 Sep 2009
Posts: 15
Location: bangalore

PostPosted: Thu Oct 01, 2009 3:19 pm
Reply with quote

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. icon_smile.gif

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
Back to top
View user's profile Send private message
radhikavasu

New User


Joined: 11 Nov 2008
Posts: 4
Location: USA

PostPosted: Tue Oct 13, 2009 1:55 am
Reply with quote

I think it would be more useful if you provide pannels also
Back to top
View user's profile Send private message
ShameemOracle

New User


Joined: 23 Sep 2009
Posts: 15
Location: bangalore

PostPosted: Tue Oct 13, 2009 10:34 am
Reply with quote

radhikavasu wrote:
I think it would be more useful if you provide pannels also


Hi Radhika,

As i mentioned in the REXX comment, i am using my own customized version of the IBM panel ISP.SISPPENU(ISRUAISE) and ISP.SISPPENU(ISRUAIES).

So if you want to try the REXX you can substitue

DSNOP1 -> ISRUAISE
DSNOP2 -> ISRUAIES


Hope this helps... feel free to ask if you need any more information on this
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top