View previous topic :: View next topic
|
Author |
Message |
Krushna Maharana
New User
Joined: 25 Nov 2007 Posts: 3 Location: Weston, FL
|
|
|
|
Hi,
I have a requirement where we need to merge available GDGs and create a report on a tabular form. Now I went thru numerous examples which helps you merging two files with SPLICE on ICETOOL. But in my requiement the number of files varies from one to 30 in a particulat month. I mean in the day-1 its just one file. in Day 5 there would be 5 files to merge. So basically my files are catalogued as an GDG version to a base. Let me give an example to explain more.
PSAK.DAILY.STAT is the GDG base.
PSAS.DAILY.STAT.G0001V00
----------------------------------
ABC 002345
DEF 002965
AKL 002878
PSAS.DAILY.STAT.G0002V00
----------------------------------
ABC 002300
DEF 002989
AKL 002899
So this way I see a new version gets catalogued. Now I need a final process which summarizes them on a daily basis by reading all the available version. So Looking at the 1st two versions it should have below result.
ABC 002345 002300
DEF 002965 002989
AKL 002878 002899
So everyday with an additional GDG version I should see one more extra column gettting added. The number of rows on every GDG is fixed. In this case its 3. The number of coumn is also fixed. Onlt the value on the 2nd column varies and the 1st column is a key and remain fixed on every GDG version.
Is there a way to do it on GDGs ?? If so how ?? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Krushna Maharana and welcome to the forums,
What should happen on days when the process does not run (this will happen and needs to be planned for)?
When should happen if the process runs more than once on a given day (this may or may not happen depending on how missing and/or extra runs are needed)?
Might the record creation be changed to include the day-of-month as a data field? |
|
Back to top |
|
|
Krushna Maharana
New User
Joined: 25 Nov 2007 Posts: 3 Location: Weston, FL
|
|
|
|
No the process would run everyday for sure on a fixed time.
The process would run only once a day.
Yeh that can be done to have an date field in one of the records.
Do you have any solution in mind ?? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Do you have any solution in mind ?? |
Possibly.
If the records can be changed to include the "day", you won't need to work around how many generations to use. You can read the entire gdg base and control printing and summing by the day in the reocrds.
Quote: |
the process would run everyday for sure on a fixed time. |
The process can be scheduled to run every day at the same time, but there almost certainly will be an occasion when the job is not run on some day. These things do happen and are usually more likely when there has been no plan made to handle them.
If you use the gdg base as input, the problem pretty much goes away. |
|
Back to top |
|
|
Krushna Maharana
New User
Joined: 25 Nov 2007 Posts: 3 Location: Weston, FL
|
|
|
|
May be you didnt understand the need. My need was to merge the available GDGs to a single file based on a key field. Is there a way to do it. I know we can do it by ICETOOL for two files but then I dont know how do we do it when we have multile versions on a GDG. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Krushna,
Well, it's a bit tedious, but you can use a DFSORT/ICETOOL job like the following. I show four files, but you can extend that to more.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN01 DD DSN=... input file1
//IN02 DD DSN=... input file2
//IN03 DD DSN=... input file3
//IN04 DD DSN=... input file4
...
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file
//TOOLIN DD *
COPY FROM(IN01) TO(T1) USING(CTL1)
COPY FROM(IN02) TO(T1) USING(CTL2)
COPY FROM(IN03) TO(T1) USING(CTL3)
COPY FROM(IN04) TO(T1) USING(CTL4)
...
SPLICE FROM(T1) TO(OUT) ON(1,3,CH) -
WITHEACH WITH(16,6) WITH(25,6) WITH(34,6) ...
/*
//CTL1CNTL DD *
INREC OVERLAY=(300:X)
/*
//CTL2CNTL DD *
INREC BUILD=(1,3,16:7,6,300:X)
/*
//CTL3CNTL DD *
INREC BUILD=(1,3,25:7,6,300:X)
/*
//CTL4CNTL DD *
INREC BUILD=(1,3,34:7,6,300:X)
/*
...
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
May be you didnt understand the need. |
And maybe i did. . .
Quote: |
My need was to merge the available GDGs to a single file based on a key field. |
Not necessarily. I believe your need is to get the correct output.
You chose to use "merge". Your requirement may be better met by passing a single file and creating the needed output. If nothing else, it could remove a lot of unnecessary complexity. |
|
Back to top |
|
|
|