Sunday, March 31, 2013

Rexx Code to resolve the GDG version

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 + gdggena = 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.

1 comment:

  1. Is it possible to get the GDG version by giving the value of DATE of Creation???

    ReplyDelete

Popular

Featured

Three Months of Chadhei