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
 
Splicing 4 files together keeping data from each

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
speermb

New User


Joined: 27 Aug 2008
Posts: 14
Location: USA

PostPosted: Tue Sep 02, 2008 9:16 pm    Post subject: Splicing 4 files together keeping data from each
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    Post subject:
Reply with quote

speermb,

Follow the example listed here

http://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: 14
Location: USA

PostPosted: Tue Sep 02, 2008 9:38 pm    Post subject: Reply to: Splicing 4 files together keeping data from each
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    Post subject:
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 Moderator


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

PostPosted: Tue Sep 02, 2008 9:53 pm    Post subject:
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:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/

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: 14
Location: USA

PostPosted: Tue Sep 02, 2008 10:51 pm    Post subject:
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: 14
Location: USA

PostPosted: Tue Sep 02, 2008 10:54 pm    Post subject:
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 Moderator


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

PostPosted: Tue Sep 02, 2008 11:00 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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