MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem in SPLICE - It is automatically sorting?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Biskhel
Beginner


Joined: 09 Mar 2006
Posts: 5
Topics: 2

PostPosted: Thu Mar 09, 2006 5:52 am    Post subject: Problem in SPLICE - It is automatically sorting? Reply with quote

Hi,

I want to splice two files but i am expecting the original order.

Ex:

File1:
1567<-------------------------remaining data--------------> LRECL - 200
8745
6785
1784

File2:
1567<---------------------------blank---------------upto 200--->ABCDEF
1784<------------DO---------------------------------------------->GFGGFG
8745<------------DO---------------------------------------------->TRCXDS
6785<------------DO---------------------------------------------->WBGFSD

Then i will concatenate File1 & File2 - File3

If i use SPLICE like this:

SPLICE FROM(File3) TO(File4) ON(1,4,CH) WITH(201,4) WITHALL
The File3 may be like this

1567<---------------remaining data from File1 up to 200-->ABCDEF
1784<---------------------------------------------------------->GFGGFG
6785<---------------------------------------------------------->WBGFSD
8745<---------------------------------------------------------->TRCXDS

But i want like this ( as it is in File1):
1567<---------------remaining data from File1 up to 200-->ABCDEF
8745<---------------------------------------------------------->TRCXDS
6785<---------------------------------------------------------->WBGFSD
1784<---------------------------------------------------------->GFGGFG

Please let me know your valuable solutions..

Biskhel




[url][/url]
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Thu Mar 09, 2006 8:14 am    Post subject: Reply with quote

Biskhel,

You will need another pass to retain the original order of the keys. Add a seqnum to the file and and after the splice sort on that seqnum.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Mar 09, 2006 11:59 am    Post subject: Reply with quote

The SPLICE operator of DFSORT's ICETOOL sorts on the ON fields in order to bring duplicate records together so they can be spliced. As Kolusu says, if you want the spliced records to retain their original File1 order, you need to use a COPY operator to add sequence numbers to the File1 records, then use your SPLICE operator keeping the sequence numbers, and then use a SORT operator to sort on the sequence numbers and remove them.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Alain Benveniste
Beginner


Joined: 04 May 2003
Posts: 92
Topics: 4
Location: Paris, France

PostPosted: Thu Mar 09, 2006 2:14 pm    Post subject: Reply with quote

bishkel,

you show 2 files with exactly the same keys, with no duplicates. I could suppose the files have the same number of records. Well i didn't spend much time to think about that particular case but I feel it could be done in 2 passes (not sure at all if it is possible). If it's how your files look like, i can spend a few time to dig out.

Alain
Back to top
View user's profile Send private message
Biskhel
Beginner


Joined: 09 Mar 2006
Posts: 5
Topics: 2

PostPosted: Fri Mar 10, 2006 12:10 am    Post subject: Reply with quote

Hi Kolusu,Frank & Alain,

Thank you very much for your suggestions!


Bishkel
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group