Posts

Showing posts from March, 2013

Rexx Code to resolve the GDG version

Image
Here is a Rexx program which accepts the relative GDG version as used in a JCL and returns the exact GDG version which is going to be resolved to by the JES interpreter. parse var gdgbase "(" gdggen ")" rest gdgbae = "'" || gdgbase || "'" if gdggen > 0 then do    say 'Only Negative Generations Allowed'    exit end x=outtrap(list.) "listc ent("gdgbase")" x=outtrap(off) if rc > 0 then do                                          say 'The GDG doesn't exist'     Exit end gdggen = (gdggen * 2) - 1 gdggen = list.0 + gdggen a = pos('NONVSAM',list.gdggen) if A <= 0 then do     say 'The generation of GDG doesn't exist'      Exit end else do   a=a+13   dsn = strip(substr(list.gdggen,a,44))     say dsn end drop list.