View previous topic :: View next topic
|
Author |
Message |
bhim_s
New User
Joined: 19 Sep 2006 Posts: 46 Location: New Delhi
|
|
|
|
Please suggest "how can we extract the GDG limit from GDG base".
regards,
Bhim. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
bhim_s
New User
Joined: 19 Sep 2006 Posts: 46 Location: New Delhi
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
bhim_s
New User
Joined: 19 Sep 2006 Posts: 46 Location: New Delhi
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
bhim_s
New User
Joined: 19 Sep 2006 Posts: 46 Location: New Delhi
|
|
|
|
Thanks a ton SuperK. It worked
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
Could you please make me able to understand this line |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
bhim_s
New User
Joined: 19 Sep 2006 Posts: 46 Location: New Delhi
|
|
|
|
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 |
|
|
|