title: How To Read MVS System Catalog To Retrieve GDG Information?
body: <p>I have a job (JCL) on the mainframe where I want to <em>programmatically retrieve</em> a particular GDG file's recent relative generation numbers from the system catalog (API call)...where I can then programmatically dig thru the results returned by the call to figure out the relative generation numbers.  This is similar to doing TSO 3.4 on the GDG base file name where the most recent generation numbers can be seen.  IDCAMS doesn't appear to return information in a format that is friendly to a program.  Thanks!</p>
  
  <p>Example:   GDG BASE NAME:  TEST.FILE<P>
             GDG generations: <P>TEST.FILE.<strong>G0010V00</strong>
                              <P>TEST.FILE.<strong>G0011V00</strong>
                              <P>TEST.FILE.<strong>G0012V00</strong></p>