Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
REXX: display dataset info using ISPF Service DSINFO & p

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: REXX: display dataset info using ISPF Service DSINFO & p
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Conditional highlighting of rows in I... packerm CLIST & REXX 2 Thu Sep 21, 2017 6:50 pm
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us