| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| Biskhel Beginner
 
 
 Joined: 09 Mar 2006
 Posts: 5
 Topics: 2
 
 
 | 
			
				|  Posted: Thu Mar 09, 2006 5:52 am    Post subject: Problem in SPLICE - It is automatically sorting? |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Thu Mar 09, 2006 8:14 am    Post subject: |   |  
				| 
 |  
				| 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
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Frank Yaeger Sort Forum Moderator
 
  
 
 Joined: 02 Dec 2002
 Posts: 1618
 Topics: 31
 Location: San Jose
 
 | 
			
				|  Posted: Thu Mar 09, 2006 11:59 am    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| Alain Benveniste Beginner
 
 
 Joined: 04 May 2003
 Posts: 92
 Topics: 4
 Location: Paris, France
 
 | 
			
				|  Posted: Thu Mar 09, 2006 2:14 pm    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| Biskhel Beginner
 
 
 Joined: 09 Mar 2006
 Posts: 5
 Topics: 2
 
 
 | 
			
				|  Posted: Fri Mar 10, 2006 12:10 am    Post subject: |   |  
				| 
 |  
				| Hi Kolusu,Frank & Alain, 
 Thank you very much for your suggestions!
 
 
 Bishkel
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |