Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to find a GDG version

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: how to find a GDG version
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    Post subject: Re: how to find a GDG version
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    Post subject:
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    Post subject: Re: how to find a GDG version
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts GDG version number PANDU1 JCL & VSAM 4 Sat Mar 04, 2017 8:28 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us