Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Find a string in PS file opened in br... mukkas CLIST & REXX 3 Sat Feb 24, 2018 2:15 pm
No new posts How to query MAXGENS of an existing P... Chuchulo Hatyzak JCL & VSAM 4 Wed Nov 22, 2017 10:23 pm
No new posts Spool Extract for Z /os 1.04 version Khadhar Basha CLIST & REXX 3 Thu Sep 28, 2017 3:14 pm
No new posts Command to find TMEMBER name for a TPIPE Siva NKK Kothamasu IMS DB/DC 0 Wed Aug 16, 2017 6:08 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us