This is not a REXX issue, since REXX has nothing to do with dataset allocations and whatnot. Furthermore, the concept of GDG processing and management is exclusive to the realm of batch processing. If this GDG is being used in a batch job, then you should have no problem determining the current generation since that will be the (0) relative generation as of run-time.
But, to simply answer your question, I'll ask another question:
Not considering REXX, how would you normally determine this information?
Have you already reviewd the information shown in this topic