View previous topic :: View next topic
|
Author |
Message |
speermb
New User
Joined: 27 Aug 2008 Posts: 30 Location: USA
|
|
|
|
I have four files to merge together where each file contains different parts of the output file, if the key is on one file I want to keep the data. The issue comes when the key is on file 1 and 3 but not 2. I am not keeping the data from the positions I wanted from file 3. My output would have data from fille 1 correctly then data from position 91 for 361 bytes from file 3.
I had
Sortin dd file1,
dd file2,
dd file3,
dd file4
SPLICE FROM(SORTIN) TO(SORTOUT) ON(1,8,CH) -
WITHEACH -
KEEPNODUPS -
WITH(91,361) -
WITH(452,300) -
WITH(752,62)
If I do multiple steps/splices (as follow) it works.
sortin dd FILE1
dd file 2
sortout dd temp1
SPLICE FROM(SORTIN) TO(SORTOUT) ON(1,8,CH) -
WITHEACH -
KEEPNODUPS -
WITH(91,361)
sortin dd temp1
dd file3
sortout dd temp2
SPLICE FROM(SORTIN) TO(SORTOUT) ON(1,8,CH) -
WITHEACH -
KEEPNODUPS -
WITH(452,300)
sortin dd temp2
dd file4
SPLICE FROM(SORTIN) TO(SORTOUT) ON(1,8,CH) -
WITHEACH -
KEEPNODUPS -
WITH(752,62)
The issue is the run time goes up on this and I just want to know is there a better way. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
Back to top |
|
|
speermb
New User
Joined: 27 Aug 2008 Posts: 30 Location: USA
|
|
|
|
This example assumes a 1-1 correlation on the 4 files and there is not already a common key. However, I don't have a 1-1 correlation, but I do a key in positions 1-8 the issue is this key may not be on all files. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
spradeepece
Show us example of your data with DCB properties of all the files involved and we will show you how to do it. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
speermb,
I suspect what you're looking for is the new WITHANY keyword of SPLICE available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). If you use WITHANY instead of WITHEACH, it will handle the key not being on all files the way you want it to. For complete details on WITHANY, see:
Use [URL] BBCode for External Links
If you don't have PTF UK90013, ask your System Programmer to install it (it's free). |
|
Back to top |
|
|
speermb
New User
Joined: 27 Aug 2008 Posts: 30 Location: USA
|
|
|
|
DCB = LRECL=813, RECFM=FB.
Example of data
12345678 WANTED1 SPACES SPACES SPACES
12345679 WANTED2 SPACES SPACES SPACES
22222222 WANTED3 SPACES SPACES SPACES
12345678 SPACES FILE2AAAA SPACES SPACES
22222222 SPACES FILE2AAAB SPACES SPACES
12345678 SPACES FILE3AAAA FILE3BA001 SPACES
12345679 SPACES FILE3AAAB FILE3BA002 SPACES
33333333 SPACES FILE3AAAC FILE3BA002 SPACES
12345678 SPACES FILE4AAAA FILE4BA001 OPTDATA
wanted output:
12345678 WANTED1 FILE2AAAA FILE3BA001 OPTDATA
12345679 WANTED2 SPACES FILE3BA002 SPACES
22222222 WANTED3 FILE2AAAB SPACES SPACES
33333333 SPACES SPACES FILE3BA002 SPACES
got this:
12345678 WANTED1 FILE2AAAA FILE3BA001 OPTDATA
12345679 WANTED2 FILE3AAAB SPACES SPACES
22222222 WANTED3 FILE2AAAB SPACES SPACES
33333333 SPACES SPACES FILE3BA002 SPACES |
|
Back to top |
|
|
speermb
New User
Joined: 27 Aug 2008 Posts: 30 Location: USA
|
|
|
|
Frank.
From reading the WITHANY documentation this would resolve my issue, but I don't have this option yet. Is there a work around, since you made this an option there must have been many more with this issue? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Is there a work around, since you made this an option there must have been many more with this issue? |
There isn't a good work around - that's why I added this option.
Ask your System Programmer to install the PTF - it's available now. |
|
Back to top |
|
|
|