IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to find a GDG version


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lakshmi_p01

New User


Joined: 28 Sep 2005
Posts: 7

PostPosted: Wed Sep 28, 2005 11:07 am
Reply with quote

Hi,

I have a requirement in which at the end of the job, we need to write the GDG name (including the version number) and the count of records in that GDG into a PS file.

ex,

i need to write the following information into a PS file.

SAMPLE.GDG.OUTPUT.G00V010 100

--SAMPLE.GDG.OUTPUT.G00V010 is the GDG that was created in the job. and '100' is the number of records in that GDG.

Lakshmi
Back to top
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Wed Sep 28, 2005 4:25 pm
Reply with quote

One way that would seem to work would be to first, before the new generation is created, to run IDCAMS LISTCAT against the GDG base and list all of the existing generations at that moment in time. Then, run the rest of the job. At the end, run IDCAMS LISTCAT again to create a new list. Remove the duplicates from the combined lists, and what is left should be the unique new generation. Combine that with the record count and you should be all set.
Back to top
View user's profile Send private message
lakshmi_p01

New User


Joined: 28 Sep 2005
Posts: 7

PostPosted: Thu Sep 29, 2005 9:45 am
Reply with quote

Thanks much kevin.. it worked icon_smile.gif
Back to top
View user's profile Send private message
karthikraman_m

New User


Joined: 10 Jun 2005
Posts: 12
Location: India

PostPosted: Thu Sep 29, 2005 12:09 pm
Reply with quote

Hi,

If you can execute a REXX program from that job, then the taks will be very simple.

You can write a rexx program to use the listds command witht the GDG base name. It would display all the GDG versions in the ascending order. You can outtrap these lines and get the first occurence of the GDG name. That is the latest version. Please find a sample code below.

X = Outtrap('DsnRes.','*')
Address TSO "Listds '"dsname"' Level"
Do i = 1 to DsnRes.0 /* For stripping the spaces */
DsnRes.i = Strip(Word(DsnRes.i,1))
end
j=1
Do i = 1 to DsnRes.0 /* Getting only the GDGs from the DsnRes */
Idx=index(DsnRes.i,'XXX.YYY.') /* XXX.YYY is the higher level qualifiers of GDG ****/
if Idx=1 then do
gdg.j=DsnRes.i
say 'GDG ' j 'is ' gdg.j
j=j+1
end
End
j = j - 1
version = gdg.j /* version contains the latest GDG */
If j < 1 Then Do
Say "There are no GDGs!"
End


For getting the count of the records, you can open the GDG and just STEM the records into an array. Now the array size will give you the record count.

Hope it helps.

Thanks,
Karthik Raman
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts How to copy the -1 version of a membe... TSO/ISPF 4
No new posts Find the occurrence of Key Field (Par... DFSORT/ICETOOL 6
Search our Forums:

Back to Top