IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Splicing 4 files together keeping data from each


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
speermb

New User


Joined: 27 Aug 2008
Posts: 30
Location: USA

PostPosted: Tue Sep 02, 2008 9:16 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Sep 02, 2008 9:27 pm
Reply with quote

speermb,

Follow the example listed here

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.13.2.2

Hope this helps...

Cheers
Back to top
View user's profile Send private message
speermb

New User


Joined: 27 Aug 2008
Posts: 30
Location: USA

PostPosted: Tue Sep 02, 2008 9:38 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Sep 02, 2008 9:42 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Sep 02, 2008 9:53 pm
Reply with quote

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
View user's profile Send private message
speermb

New User


Joined: 27 Aug 2008
Posts: 30
Location: USA

PostPosted: Tue Sep 02, 2008 10:51 pm
Reply with quote

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
View user's profile Send private message
speermb

New User


Joined: 27 Aug 2008
Posts: 30
Location: USA

PostPosted: Tue Sep 02, 2008 10:54 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Sep 02, 2008 11:00 pm
Reply with quote

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. icon_wink.gif

Ask your System Programmer to install the PTF - it's available now.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top