Your post is not clear. Are you wanting to know if the GDG base is defined for a given set of base names, or are you wanting to know if any generations are defined for a given set of base names, or something else? Furthermore, is this a one-time thing or something you expect to run regularly? Why are you wanting to find out this information -- are you planning on doing something with the output or just satisfy your curiousity?
The long-term solution typically requires running IDCAMS LISTCAT against the GDG base and parsing (using the language of your choice) the LISTCAT output to pull out the desired information.