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

SpaceCheck of PDS through JCL (nearing SE37 condition)


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

New User


Joined: 27 Oct 2006
Posts: 8
Location: USA

PostPosted: Fri Oct 30, 2009 11:40 am
Reply with quote

Hi Everybody! I have been browsing these forums for ages now and can honestly say that they've been extremely helpful on numerous occassions. This however is my first post/query, so please be gentle icon_razz.gif

Problem Background -
We have a problem wherein most of the test region Link Library PDS's that we use run out of space at frequent intervals with an SE37. As a result, we generally end up having to bring down the related CICS regions and reallocating space to the LinkLib PDS.

Query -
What I want to know is if there is any way out automating this process by checking the space status on all the Link Libs PDS's through a JCL and checking if the PDS is nearing an SE37 condition ?

Many thanks. Looking forward to any suggestions.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Fri Oct 30, 2009 12:29 pm
Reply with quote

Do you have access to ISMF to do DASD / dataset reporting ?

Using PDSE instead of PDS

Dfdss has great selection criteria and will happily compress PDS datasets
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Oct 30, 2009 8:24 pm
Reply with quote

Hi,

Hope I am not re-inventing the wheel,

The below REXX code will give the dataset attributes in a CSV report.
you can edit the output layout by changing the put statement.

I tried this out for an adhoc task, so it may not be the optimistic solution.
Please suggest changes if there are any shortcomings in the code.

1) XK89.SPACE.EXTRACT is - VB - 177 LRECL.
It contains the list of datasets you want to test,
It looks like,

Code:
EDIT       XK89.SPACE.EXTRACT                     
Command ===>                                     
****** ***************************** Top of Data *
000001 XK89.BORED.LOADLIB                         
000002 XK89.BORED.LOADLIB2                       
000003 XK89.BORED.LOADLIB4                       
****** **************************** Bottom of Data



2) XK89.LAZY.REPORT will contain the output report in CSV format.

Put the i/p datasets in XK89.SPACE.EXTRACT & run the code you will get the o/p in XK89.LAZY.REPORT.



Code:
/* REXX                              */                             
/*************************************/                             
/* AUTHOR - VASANTH S                */                             
/* 13/09/2007 13:56 HRS              */                             
/* NOTE : SOURCE DATSET SHOULD BE VB */                             
/*************************************/                             
"ALLOC F(THINK) DS('"XK89.LAZY.REPORT"') OLD"                       
INPUT_FILE ="'XK89.SPACE.EXTRACT'"                                   
"ALLOC FI(INPF) DA("INPUT_FILE") SHR"                               
"EXECIO * DISKR INPF (STEM INP_LINES. FINIS "                       
J=1                                                                 
REC.1 = 'DATASET,TYPE,PRIMARY,SECONDARY,VOLUMES,ACTUAL ALLOCATED,'||,
'ACTUAL USED,MAX ALLOC. POSSIBLE,ACTUAL % USED,MAX ALLOC. %USED,'||,
'SMS IND,RECFMT,LREC,BLKSIZE,M.CLASS,CYLTRK,FPRI,FSEC'               
PARSE VAR REC.1 1 PART1 48 49 PART2 51 52                           
DO I = 1 TO INP_LINES.0                                             
  M=STRIP("'"INP_LINES.I"'")                                         
  Y=STRIP(INP_LINES.I)                                               
  SAY 'NOW PROCESSING ' M                                           
  ADDRESS ISPEXEC "DSINFO DATASET("M")"                             
  IF (ZDSORG = 'PS' | ZDSORG = 'PO') THEN                           
  DO                                                                 
    X=TRANSLATE(ZDSTOTA,,',')                                       
    PARSE VAR X X1 X2                                               
    X=X1||X2                                                         
/*  SAY 'ZDSTOTA:' X             */                                 
    Z=STRIP(X)                                                       
    X=TRANSLATE(ZDSTOTU,,',')                                       
    PARSE VAR X X1 X2                                               
    A=X1||X2                                                         
/*    SAY 'ZDSTOTA:' A           */                                 
    V=STRIP(A)                                                       
    ZDSTOTA_TEMP = Z * 1                                             
    ZDSEXTA=STRIP(ZDSEXTA)                                           
  IF ZDSSPC = 'CYLINDER' THEN                                       
   DO                                                               
     CYLTRX = 'CYL'                                                 
    IF (Z > 1000) | (Z = 1000) THEN                                 
      DO                                             
       FPRI = Z + 500                                 
       FSEC = 50                                     
    END                                               
                                                     
    IF (Z < 500) & (Z > 100) THEN                     
      DO                                             
       FPRI = Z + 150                                 
       FSEC = 20                                     
    END                                               
                                                     
    IF (Z < 100) THEN                                 
      DO                                             
       FPRI = Z + 50                                 
       FSEC = 10                                     
    END                                               
    IF (Z = 500) THEN                                 
      DO                                             
       FPRI = Z + 150                                 
       FSEC = 20                                     
    END                                               
    IF (Z   > 500) &  (Z <  1000) THEN               
      DO                                             
       FPRI = Z + 250                                 
       FSEC  = 30                                     
    END                                               
                                                     
  END                                                 
  IF ZDSSPC = 'TRACK' THEN                           
    DO                                               
     CYLTRX = 'TRK'                                   
    IF (Z > 100) | (Z = 100) THEN                     
      DO                                             
       FPRI = Z + 100                                 
       FSEC = 30                                     
    END                                               
                                                     
    IF (Z < 50) | (Z = 50) THEN                       
      DO                                                               
       FPRI = Z + 50                                                   
       FSEC = 20                                                       
    END                                                                 
                                                                       
    IF (Z   > 50) &  (Z <  100) THEN                                   
      DO                                                               
       FPRI = Z + 75                                                   
       FSEC  = 20                                                       
    END                                                                 
  END                                                                   
/*    SAY 'Z:' Z */                                                     
/*  SAY 'V:' V   */                                                     
/*  SAY 'ZDSEXTA:' ZDSEXTA  */                                         
/*  SAY 'ZDS2EX:' ZDS2EX    */                                         
    PRI_CYL=(Z - ((ZDSEXTA-1) * ZDS2EX))                               
    SEC_CYL=STRIP(ZDS2EX)                                               
    IF ZDSTOTA_TEMP > 0 THEN                                           
    DO                                                                 
      ACTUAL_PCT = 100 - (((Z - V) / Z) * 100)                         
    END                                                                 
    ELSE                                                               
    DO                                                                 
      ACTUAL_PCT = 'ALLOCATED=0'                                       
    END                                                                 
    IF ZDS#VOLS > 1 THEN                                               
    DO                                                                 
      MAX_ALLOC = 'NA'                                                 
      MAX_PCT = 'NA'                                                   
  J=J+1                                                                 
  Y=LEFT(Y,48," ")                                                     
  REC.J = Y||','||ZDSORG||','||PRI_CYL||ZDSSPC||','||SEC_CYL||ZDS2SPC||,
          ','||ZDS#VOLS||','||Z||ZDSSPC||','||V||','||,                 
          MAX_ALLOC||','||ACTUAL_PCT||','||MAX_PCT','||ZDSDC||,         
         ','||ZDSRF||','||ZDSLREC||','||ZDSBLK||','||ZDSMC||,           
         ','CYLTRX||','||FPRI||','||FSEC                               
    END                                                                 
    ELSE                                                               
    DO                                                                 
      MAX_ALLOC = PRI_CYL + 15 * ZDS2EX                                 
      MAX_ALLOC_TEMP = MAX_ALLOC * 1                                   
      IF MAX_ALLOC_TEMP > 0 THEN                                       
      DO                                                               
      MAX_PCT = 100 - (((MAX_ALLOC - V) / MAX_ALLOC) * 100 )           
      END                                                               
      ELSE                                                             
      DO                                                               
      MAX_PCT = 'MAX ALLOC=0'                                           
      END                                                               
  J=J+1                                                                 
  Y=LEFT(Y,48," ")                                                     
  REC.J = Y||','||ZDSORG||','||PRI_CYL||ZDSSPC||','||SEC_CYL||ZDS2SPC||,
          ','||ZDS#VOLS||','||Z||ZDSSPC||','||V||','||,                 
         MAX_ALLOC||ZDSSPC||','||ACTUAL_PCT||','||MAX_PCT','||ZDSDC||, 
         ','||ZDSRF||','||ZDSLREC||','||ZDSBLK||','||ZDSMC||,           
         ','CYLTRX||','||FPRI||','||FSEC                               
    END                                                                 
  END                                                                   
END                                                                     
REC.0 = J                                                               
"EXECIO * DISKW THINK (FINIS STEM REC."                                 
"FREE FILE(INPF)"                                                       
"FREE FILE(THINK)"                                                     
EXIT                                                                   


Hope this helps. icon_smile.gif
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Oct 30, 2009 8:30 pm
Reply with quote

Hi,

O/p Would look something like the attached screen dump,

Regards,
Back to top
View user's profile Send private message
Apotheosis

New User


Joined: 27 Oct 2006
Posts: 8
Location: USA

PostPosted: Fri Nov 06, 2009 11:30 am
Reply with quote

@Expat - Thank you for getting back. I do not think we have ISMF in our shop or if we do, I am not aware. I will probably need to check with the Storage group regarding this. Using PDSE would indeed have been the best way to go, but most of these linklibs are ages old and will probably need to be redefined as PDSEs.
Back to top
View user's profile Send private message
Apotheosis

New User


Joined: 27 Oct 2006
Posts: 8
Location: USA

PostPosted: Fri Nov 06, 2009 11:31 am
Reply with quote

@Vasanthz - Ah, thanks for helping mate. I'll give this a go. Might be really helpful. Thanks for playing the Good Samaritan. Cheers !
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 06, 2009 12:58 pm
Reply with quote

Yes... Vasanth, You are reinventing the wheel icon_biggrin.gif

I wonder why nobody cares to look at the ISMF dataset listing and reporting dialog

it' s there, terrific filtering capabilities, gives all the info anybody would need

General consideration on
I wonder why there is such ignorance in the support groups ( storage in this case )

but the general tone of the posts suggests that support in the organization where the TS(Topic Starters) work
is pretty incompetent/ignorant/lazy/<add as many derogatory adjectives as You like>
same applies to the management

the usual approach in any decently managed organization
is to provide the end users with the most common and proper
tools/<how to's>/<code-jcl snippets>/pointers to the manuals
to enable them to carry on the most common tasks respecting the organization standards and practices
and please do not ask about having the ISMF results in a dataset... SAVE is there
Back to top
View user's profile Send private message
Apotheosis

New User


Joined: 27 Oct 2006
Posts: 8
Location: USA

PostPosted: Fri Nov 06, 2009 1:03 pm
Reply with quote

Hey Enrico ... What would be the newbies guide to checking if ISMF exists and if it does - how do I go about checking its reporting facilities. Thanks in advance.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 06, 2009 1:10 pm
Reply with quote

it all depends on Your primary ISPF options menu...

a note... ISMF provides sophisticated dialogs..
for a quick and dirty approach the plain ISPF 3.4 provides enough info
( for the newest ISPF releases at least )
the filtering is not that sophisticated but by sorting on the proper columns is a workable substitute
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Nov 06, 2009 4:36 pm
Reply with quote

Hi Enrico,

You are right & I agree that we can use 3.4 option which has the % used and other statistics.
But actually it has some shortcomings,
1. If there is a requirement to monitor all system file prefixed with DLL.* which is about 13K datasets then it would consume quite a lot of time fetching the data from the catalogs.
2. After fetching, the command "SORT %used", it too will take quite sometime.
3. copying all the statistics of 3.4 option to a PSfile through SAVE LIST command will still take some wait time.
4. All these processes are in foreground and the operator has to wait till the operations are over.

Also sometimes the stats shown in 3.4 are not exactly correct. I don't remember the exact scenario though.

This is the reason why I was forced to re-invent the wheel

If the 3.4 can be considered as a tyre. Then the above REXX can be considered as a tubeless tyre icon_biggrin.gif

TY for ISMF info. I will try it out.

Thanks & Regards,
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 06, 2009 4:41 pm
Reply with quote

Hi Vasanth!

if You do not want to sit in front of the screen waiting check the NAVIQUEST approach

a set of already made REXX scripts to run in batch some of the ISMF tasks
both admin and user
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 How to give complex condition in JCL . CLIST & REXX 30
No new posts selectively copy based on condition DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. Control-m JOB executing even when the... Compuware & Other Tools 6
No new posts Dynamic condition checks COBOL Programming 5
No new posts Extract 2 more lines below line that ... DFSORT/ICETOOL 2
Search our Forums:

Back to Top