View previous topic :: View next topic
|
Author |
Message |
lakshmi_p01
New User
Joined: 28 Sep 2005 Posts: 7
|
|
|
|
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 |
|
|
Kevin
Active User
Joined: 25 Aug 2005 Posts: 234
|
|
|
|
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 |
|
|
lakshmi_p01
New User
Joined: 28 Sep 2005 Posts: 7
|
|
|
|
Thanks much kevin.. it worked |
|
Back to top |
|
|
karthikraman_m
New User
Joined: 10 Jun 2005 Posts: 12 Location: India
|
|
|
|
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 |
|
|
|