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

Findout the Available Free space for a Storage Group


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sam_nura

New User


Joined: 04 Dec 2008
Posts: 46
Location: Bangalore

PostPosted: Wed Aug 05, 2009 3:40 pm
Reply with quote

Hi,
By using ISMF panel we can find out the available free space for a particular storage.Any one know how to find out this through JCL/Rexx job?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 05, 2009 3:50 pm
Reply with quote

VL records from DCOLLECT (Detailed in the IDCAMS manual).
Back to top
View user's profile Send private message
Sam_nura

New User


Joined: 04 Dec 2008
Posts: 46
Location: Bangalore

PostPosted: Fri Aug 07, 2009 12:45 pm
Reply with quote

Hi expat,
i tried but it not showing the free space information. it shows only the dataset related information for a particular storage group.Below are the JCL which is used,

//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//OUTDS DD DSN=HLQ.DCOLLECT.OUTPUT,
// DSORG=PS,
// DCB=(RECFM=VB,LRECL=644,BLKSIZE=0),
// SPACE=(1,(100,100)),AVGREC=K,
// DISP=(NEW,CATLG,KEEP)
//SYSIN DD *
DCOLLECT -
OFILE(OUTDS) -
CAPPLANDATA -
SMSDATA(SCDSNAME(ACTIVE))-
STORAGEGROUP(TSOSG)
/*
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Aug 07, 2009 12:52 pm
Reply with quote

Code:
//SYSIN    DD *                                       
 DCOLLECT OFILE(COLLDATA) SMSDATA(ACTIVE) NODATAINFO   
 SET MAXCC EQ 0                                       
/*                                                     

After running this, you will need to analyse the VL records to get the result you need.

Also take a look at the DFSORT forum because somewhere in the sort documentation FRank has written some storage analysis procedures which may contain exactly what you need.

Also, speak to your storage management group who may already accumulate this information.
Back to top
View user's profile Send private message
Sam_nura

New User


Joined: 04 Dec 2008
Posts: 46
Location: Bangalore

PostPosted: Fri Aug 07, 2009 1:01 pm
Reply with quote

thanks expat.. i am the one part of the storage management group. currently we are getting this information through ISMF panels only.we planned if we get through batch then would be better to automate the volume allocation issues.
from your input we need to do some sorting to get the VL records properly.i am right expat.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Aug 07, 2009 2:07 pm
Reply with quote

The VL or the V records are equally informative. Here's a job I created years ago for DASD reporting using the V records. You may need to tailor it for your own usage.

Put the REXX code into a PDS, and put the PDS name and member name into the JCL of the last step and give it a go.

The JCL
Code:

//*
//REPTCARD EXEC PGM=IEBGENER
//SYSUT1   DD *
*  SORT (29,6) BY VOLSER, (81,2) BY UCB, (87,8) BY SMS STORAGE GROUP
*  ALSO USE THESE FIELDS FOR INCLUDE / EXCLUDE SPECIFICS
 OPTION  VLSCMP
 INCLUDE COND=(9,2,CH,EQ,C'V ',AND,
               (87,8,CH,EQ,C'SGroup01',OR,
                87,8,CH,EQ,C'SGroup02',OR,
                87,8,CH,EQ,C'SGroup03'))
 SORT    FIELDS=(87,8,CH,A,29,6,CH,A)
/*
//SYSUT2   DD DSN=&&REPCARD,DISP=(,PASS,DELETE),
//            SPACE=(TRK,(10,10),RLSE),RECFM=FB,LRECL=80
//SYSOUT   DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//*
//DCOLLECT EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DCOLL    DD DSN=&&DCOLLECT,
//            DISP=(,PASS,DELETE),
//            SPACE=(CYL,(100,100),RLSE),
//            RECFM=VB,LRECL=2004
//SYSIN    DD *
 DCOLLECT  OFILE(DCOLL) ERRORLIMIT(1) NODATAINFO VOLUMES(*)
 SET MAXCC EQ 0
/*
//*
//SORT01   EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN   DD DSN=&&DCOLLECT,DISP=SHR
//SORTOUT  DD DSN=&&DCOLLECS,DISP=(,PASS,DELETE),
//            SPACE=(CYL,(50,20),RLSE),
//            RECFM=VB,LRECL=2004
//SYSIN    DD DSN=&&REPCARD,DISP=(OLD,DELETE)
//*
//REXXEXEC EXEC PGM=IKJEFT01,PARM='member name'
//SYSEXEC  DD DSN=Your REXX library,DISP=SHR
//DCO      DD DSN=&&DCOLLECS,DISP=(SHR,DELETE)
//INFOSMS  DD SYSOUT=*,RECFM=FBA,LRECL=121
//ERRORS   DD SYSOUT=*,RECFM=FBA,LRECL=121
//SYSOUT   DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD DUMMY

The REXX
Code:

/* REXX *** VOLUME STATISTICS ANALYSIS AND REPORT                    */
MSG = MSG(OFF)
KBTRK  = 55.333333333333
TRKDEV = 16695
TLINE  = 0
ERRCNT = 0
CC = 1
PRTT1A = CC"VOLSER UCB  DEV      STORGRP   MOUNT   INDEX "
PRTT1B = "            TYPE     IF SMS    ATTRIB  STATUS"
PRTT2A = " PCT FREE    FREE   LARGEST  VTOC   VIR"
PRTT2B = " FREE EXTS    TRKS   FREE TR  FREE  FREE"
SYSUID = SYSVAR(SYSUID)
"EXECIO * DISKR DCO ( STEM DCOLL. FINIS"
DO A = 1 TO DCOLL.0
   RECTYPE = SUBSTR(DCOLL.A,5,2)
   IF RECTYPE = 'V ' THEN DO
      VOLSER = SUBSTR(DCOLL.A,25,6)
      UCB    = C2X(SUBSTR(DCOLL.A,77,2))
      STAT03 = SUBSTR(X2B(C2X(SUBSTR(DCOLL.A,31,1))),1,2)
      IF STAT03 = '11' THEN INDX = ' OK'
      IF STAT03 = '10' THEN INDX = 'OFF'
      IF STAT03 = '00' THEN INDX = 'NIX'
      STAT04 = SUBSTR(X2B(C2X(SUBSTR(DCOLL.A,31,1))),3,3)
      IF STAT04 = '100' THEN MOUNT = 'PRIVATE'
      IF STAT04 = '010' THEN MOUNT = ' PUBLIC'
      IF STAT04 = '001' THEN MOUNT = 'STORAGE'
      PCT      = RIGHT(X2D(C2X(SUBSTR(DCOLL.A,36,1))),3)
      CAP2     = X2D(C2X(SUBSTR(DCOLL.A,45,4)))
      CAP      = CAP2 % KBTRK
      DM       = CAP % TRKDEV
      DX       = STRIP("-"DM)
      DEVX     = SUBSTR(DCOLL.A,113,4)
      HD       = '?'
      SELECT
       WHEN DEVX = '2105' THEN HD = 'E'
       WHEN DEVX = '9392' THEN HD = 'H'
       WHEN DEVX = '9393' THEN HD = 'V'
        OTHERWISE END
      DEVT     = SUBSTR(DCOLL.A,69,4)
      DEVT     = DEVT||DX||" "||HD
      STGRP    = SUBSTR(DCOLL.A,83,8)
      EXT      = RIGHT(X2D(C2X(SUBSTR(DCOLL.A,57,4))),3)
      KFREE  = SUBSTR(DCOLL.A,37,4)
      KFREE2 = X2D(C2X(KFREE))
      KFREE4 = KFREE2 // KBTRK
      KFREE5 = KFREE2 % KBTRK
      IF KFREE4 >  0 THEN DO
        KFREE5 = KFREE5 + 1
      END
      KFREE5 = RIGHT(KFREE5,6)
      KBIG   = SUBSTR(DCOLL.A,53,4)
      KBIG2  = X2D(C2X(KBIG))
      KBIG4  = KBIG2  // KBTRK
      KBIG5  = KBIG2  % KBTRK
      IF KBIG4  > 0 THEN DO
        KBIG5  = KBIG5 + 1
      END
      KBIG5  = RIGHT(KBIG5,6)
      VTOC1  = SUBSTR(DCOLL.A,61,4)
      VTOC   = X2D(C2X(VTOC1))
      VTOC   = RIGHT(VTOC,5)
      VIR1   = SUBSTR(DCOLL.A,65,4)
      VIR    = X2D(C2X(VIR1))
      VIR    = RIGHT(VIR,5)
 IF TLINE = 0 THEN DO
 PUSH PRTT1A PRTT2A
 "EXECIO 1 DISKW INFOSMS"
 PUSH PRTT1B PRTT2B
 "EXECIO 1 DISKW INFOSMS"
 PUSH "            "
 "EXECIO 1 DISKW INFOSMS"
 TLINE = TLINE + 1
 PRTL  = 0
 END
 PRT01 = " "VOLSER UCB DEVT STGRP MOUNT
 PRT02 = "  "INDX "   "PCT " "EXT " "KFREE5 "   "KBIG5 VTOC VIR
 PUSH PRT01 PRT02
 "EXECIO 1 DISKW INFOSMS"
 PRTL = PRTL + 1
 IF PRTL = 55 THEN DO
   TLINE = 0
 END
     IF INDX <> " OK" | VTOC < 150 | VIR < 150 THEN DO
        ERRCNT   = ERRCNT + 1
        ERRS.0   = ERRCNT + 1
        ERRS.ERRCNT = PRT01 PRT02
     END
   END
END
PRTL = 55
DO A = 1 TO ERRCNT
   IF PRTL = 55 THEN DO
     PUSH PRTT1A PRTT2A
     "EXECIO 1 DISKW ERRORS"
     PUSH PRTT1B PRTT2B
     "EXECIO 1 DISKW ERRORS"
     PUSH "            "
     "EXECIO 1 DISKW ERRORS"
     PRTL = 0
   END
   PUSH ERRS.A
   "EXECIO 1 DISKW ERRORS"
   PRTL = PRTL + 1
END
EXIT
Back to top
View user's profile Send private message
Sam_nura

New User


Joined: 04 Dec 2008
Posts: 46
Location: Bangalore

PostPosted: Fri Aug 07, 2009 3:05 pm
Reply with quote

Hi Expat I ran your code. Its working fine. your code is more than enough for my requirement. Thanks a lot EXPAT..
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Aug 07, 2009 3:45 pm
Reply with quote

Invoice in the post icon_lol.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts CICS vs LE: STORAGE option CICS 0
No new posts Insufficient Storage ABENDS & Debugging 7
No new posts Compare latest 2 rows of a table usin... DB2 1
Search our Forums:

Back to Top