tags:

views:

357

answers:

2

How to know GDG base properties through REXX code; Of course we can view the GDG limit thru File-aid 3.2 option But need to list the properties on the fly and may be used in consecutive program/module. Hope made you clear and waiting for response! (Do let me know if any other information is required?)

A: 

From REXX, you can target TSO then use the listcat command:

ADDRESS TSO
"LISTCAT ENTRY('XXX') ALL"

where XXX is the GDG base.

For capturing TSO output, look into OUTTRAP which can capture the output from most TSO commands - I haven't specifically tested listcat since I don't have a z900 under my desk at home :-) I'll give it a shot at work tomorrow.

Call OutTrap "xyzzy."

should give you the output into the xyzzy stem variable and you can stop the capture with:

Call OutTrap "off"
paxdiablo
To me, this is similar to using file-aid 3.2. But, Pax, can I save the info somewhere in the buffer for further usage? I mean, I wanna use them by another REXX exec/cobol mod etc.Your response is really appreciated!!
Raja Reddy
Seems will work! Would update once i try it tomorrow at office :) Thanks!!
Raja Reddy
The above will work, but you need to parse the trapped output. You could also try [LISTDSI](http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/IKJ4A360/4.4.2?DT=20050714012324#HDRLDSI) which provides most DS attributes directly as REXX variables. The only catch is that LISTDSI needs the absolute GDG generation number (eg. G0000V00) as opposed to the relative number (eg. 0, -1, etc).
NealB
A: 

One caveate to the above suggestion... If you only want GDG entries you may need to consider removing the keyword ALL on the LISTCAT ENTRY('XXX') ALL line. I believe the ALL word will list GDG & Non-GDG datasets that happen to match the catalog entry name.

MikeC