Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Extracting GDG Limit

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Extracting GDG Limit
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

Moderator Team Head


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

PostPosted: Wed Sep 05, 2007 4:54 pm    Post subject: Reply to: Extracting GDG Limit
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    Post subject:
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

Moderator Team Head


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

PostPosted: Wed Sep 05, 2007 5:40 pm    Post subject: Reply to: Extracting GDG Limit
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

Moderator Team Head


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

PostPosted: Wed Sep 05, 2007 5:45 pm    Post subject: Reply to: Extracting GDG Limit
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    Post subject:
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

Moderator Team Head


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

PostPosted: Wed Sep 05, 2007 7:53 pm    Post subject: Reply to: Extracting GDG Limit
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    Post subject:
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

Moderator Team Head


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

PostPosted: Fri Sep 07, 2007 8:47 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm
No new posts Limit CICS CPU resource vasanthz CICS 0 Tue Jan 31, 2017 7:09 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Extracting Information from DD Statem... Charles Wolters All Other Mainframe Topics 7 Wed Apr 13, 2016 10:21 pm
No new posts Commit limit for Delete query through... mf_karthik DB2 10 Thu Dec 17, 2015 12:56 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us