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

Extracting GDG Limit


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

New User


Joined: 19 Sep 2006
Posts: 46
Location: New Delhi

PostPosted: Wed Sep 05, 2007 4:45 pm
Reply with quote

Please suggest "how can we extract the GDG limit from GDG base".

regards,
Bhim.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Sep 05, 2007 4:54 pm
Reply with quote

See this previous topic for methods.
Back to top
View user's profile Send private message
bhim_s

New User


Joined: 19 Sep 2006
Posts: 46
Location: New Delhi

PostPosted: Wed Sep 05, 2007 5:11 pm
Reply with quote

Thanks SuperK ... but i want to do it in REXX code so that i can capture this information(gdg limit) in a variable for further use in the program.
as i have thousand of GDG's to find their limit.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Sep 05, 2007 5:40 pm
Reply with quote

Yes, I know. Everything you need to do what you want is in that post. Beyond that, a search of the REXX/CLIST Forums should find anything else you might need.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Sep 05, 2007 5:45 pm
Reply with quote

Specifically, this post here:

Quote:

To know the limit first u have to go to option 6

1) 6 COMMAND - Enter TSO command or CLIST

2) Enter TSO or Workstation commands below:

===> listcat gdg ent('I004.TEST.GDG') all

3) PRESS ENTER

U WILL GET THE DETAILS ......HOPE IT WILL BE USEFUL


Which also shows the expected results:

Code:

GDG BASE ------ myuser.gdg
IN-CAT --- USERCAT.TRY                               
HISTORY                                               
  DATASET-OWNER----xxxxxx     CREATION--------2005.013
  RELEASE----------------2     EXPIRATION------0000.000
ATTRIBUTES                                             
  LIMIT-----------------20     SCRATCH          NOEMPTY
ASSOCIATIONS--------(NULL)


which is the output you can parse and retrieve the LIMIT value.
Back to top
View user's profile Send private message
bhim_s

New User


Joined: 19 Sep 2006
Posts: 46
Location: New Delhi

PostPosted: Wed Sep 05, 2007 6:23 pm
Reply with quote

Here is my code:

Code:

/* REXX STP999*/                                                       
/* ****************************************************************** */
/*call read_input*/                                                     
/*add_input:*/                                                         
    "Alloc Fi(DDin) da('ZXXXXXX.DSN.CATLG') shr"                       
    "ExecIO * DiskR DDin (Stem Lines. Finis "                           
    "Free Fi(DDin)"                                                     
    /*structure of the file*/                                           
      wrkfile=substr(lines.2,1,50)                                     
      dltng=substr(lines.2,52,50)                                       
      used=substr(lines.2,103,10)                                       
      gdgv=substr(lines.2,114,50)                                       
      lmt=substr(lines.2,165,5)                                         
      gdgv=space(gdgv,0)                                                 
      len = length(gdgv)                                                 
      say "length of the gdgv" len                                       
      gdgbase=substr(gdgv,1,len-4)                                       
      trace i           
      "listc ent('"gdgbase"') all"               
      say "gdgbase" gdgbase                       
      trace n                                     
      exit 0                                     
      /*return*/   
       


Can you please help how i can parse and retrieve the LIMIT value.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Sep 05, 2007 7:53 pm
Reply with quote

This is how I would do it (as a REXX Function):

Code:

GET_LIMIT:                               
limit = 0                                 
Parse Arg gdg_base .                     
x = Outtrap(lc.)                         
"LISTC ENT('"gdg_base"') ALL"             
x = Outtrap(Off)                         
Do i = 1 To lc.0                         
  Parse Var lc.i limit_attr '-' limit .   
  limit_attr = Strip(limit_attr)         
  If limit_attr = 'LIMIT' Then           
    Do                                   
      limit = Strip(limit,L,'-')         
      Leave i                             
    End                                   
End                                       
Drop lc.                                 
Return limit                             
Back to top
View user's profile Send private message
bhim_s

New User


Joined: 19 Sep 2006
Posts: 46
Location: New Delhi

PostPosted: Thu Sep 06, 2007 5:18 pm
Reply with quote

Thanks a ton SuperK. It worked icon_smile.gif

But i could not uderstand the working of following line of code as i am not so much familier with rexx.

Code:
  Parse Var lc.i limit_attr '-' limit . 


I tried rexx pdf but coudn't help icon_sad.gif
Could you please make me able to understand this line icon_redface.gif
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Sep 07, 2007 8:47 pm
Reply with quote

bhim_s wrote:
I tried rexx pdf but coudn't help


That's the second time I've seen you state that. What is it supposed to mean (what is the "rexx pdf")?

Anyway

Code:

Parse Var lc.i limit_attr '-' limit .


means, basically

"Parse the Variable lc.i into the variable limit_attr,
use the single dash as a delimiter, then continue the parse into the next variable limit, then stop parsing at the first blank character."

As you probaby know, the output from the LISTCAT command contains a line the looks like this:

Code:

       LIMIT-------------------------3


So, the Parse instruction breaks it up into this:

Code:

limit_addr = '       LIMIT'
limit      = '------------------------3'
Back to top
View user's profile Send private message
bhim_s

New User


Joined: 19 Sep 2006
Posts: 46
Location: New Delhi

PostPosted: Wed Sep 19, 2007 4:16 pm
Reply with quote

Yes i know LISTCAT Thank you so much now i got this. Really appreciate your help.

REXX pdf means REXX-adobe reader eBook
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Help in extracting data between doubl... DFSORT/ICETOOL 5
No new posts Expand ISPF field up to a limit - is ... TSO/ISPF 9
No new posts Extracting Compression Statistics fro... PL/I & Assembler 2
No new posts Rexx to list generations of GDGs and ... CLIST & REXX 3
Search our Forums:

Back to Top