0

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?)

Raja Reddy
  • 772
  • 8
  • 19
  • 37
  • Ah REXX! This brings back happy memories of using VM/CMS on an IBM 4381 back in the 80s. I wrote a whole distributed printing system in REXX. Sorry that I can't answer your question though. –  Mar 07 '10 at 12:20
  • That's great Mr.Neil. Nice to have my query glanced by you! – Raja Reddy Mar 07 '10 at 12:43

3 Answers3

1

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
  • 854,327
  • 234
  • 1,573
  • 1,953
  • 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 Mar 07 '10 at 12:46
  • Seems will work! Would update once i try it tomorrow at office :) Thanks!! – Raja Reddy Mar 07 '10 at 12:53
  • 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 Mar 08 '10 at 17:20
0

Something like this should do it.

/* REXX */                                     

arg entry .                                    

call outtrap "listc."                          

"LISTCAT ENT("entry") GDG ALL"                 
if rc > 0 then exit 12                         

do i = 1 to listc.0                            
  if pos("LIMIT", listc.i) > 0 then do         
    limit = word(translate(listc.i,' ','-'),2) 
    say 'GDG limit is' limit                   
    leave                                      
  end                                          
end  
David Crayford
  • 571
  • 1
  • 3
  • 10
-1

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
  • 408
  • 2
  • 4
  • 9