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

Splice - only comparison, no sorting


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

Active User


Joined: 22 Dec 2005
Posts: 116

PostPosted: Tue Oct 16, 2007 11:09 am
Reply with quote

Hi,
I am comparing 2 files and changing certain values in the master file. For this I am using the below mentioned splice statement.
SPLICE FROM(T1) TO(OUT) ON(13,11,CH) ON(30,4,CH) -
WITH(48,5) KEEPNODUPS

I really want only to compare the records, nut not to sort all the records based on (13,11,CH) and (30,4,CH). But this splice statement does a sort also, which I really don't want. Any solution for this.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Oct 16, 2007 11:33 am
Reply with quote

pjnithin
This ICETOOL JOB retains the original order of the i/p records, and note that the preference is to the record in the first input file and can be changed as per your requirement.
Code:
//*******************************************************               
//STEP001  EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD *                                                         
VICKY                                                                   
FRANK                                                                   
CARRIE                                                                 
HOLLY                                                                   
PAUL                                                                   
/*                                                                     
//IN2      DD *                                                         
KAREN                                                                   
HOLLY                                                                   
CARRIE                                                                 
VICKY                                                                   
MARY                                                                   
/*                                                                     
//TMP1     DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA 
//TMP2     DD DSN=&&TEMP2,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA 
//BOTH     DD SYSOUT=*                                                 
//TOOLIN   DD *                                                         
 COPY FROM(IN1)  TO(TMP1) USING(CP01)                                   
 COPY FROM(IN2)  TO(TMP1) USING(CP02)                                   
 SPLICE FROM(TMP1) TO(TMP2) ON(1,10,CH) WITH(1,10) KEEPNODUPS           
 SORT FROM(TMP2) TO(BOTH) USING(CP03)                                   
/*                                                                     
//CP01CNTL DD   *                                                       
  OUTREC BUILD=(1,10,12:SEQNUM,8,ZD,20:C'11')                           
/*                                                                     
//CP02CNTL DD   *                                                       
  OUTREC BUILD=(1,10,12:SEQNUM,8,ZD,20:C'22')                           
/*                                                                     
//CP03CNTL DD   *                                                       
  SORT FIELDS=(12,8,ZD,A,20,2,CH,A)                                     
  OUTFIL FNAMES=BOTH,BUILD=(1,10)                                       
/*                                                                     


BOTH contains matched records in the following order.
Code:
VICKY   
KAREN   
FRANK   
CARRIE 
HOLLY   
PAUL   
MARY   
Back to top
View user's profile Send private message
pjnithin

Active User


Joined: 22 Dec 2005
Posts: 116

PostPosted: Tue Oct 16, 2007 4:28 pm
Reply with quote

other than by giving the rec count and sorting it again, is there any other method to rtain the order of the record after splicing it.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Oct 16, 2007 4:35 pm
Reply with quote

Nithin.

Quote:
other than by giving the rec count and sorting it again

No.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Oct 16, 2007 4:41 pm
Reply with quote

pjnithin
You have to take up extra step of sorting to retain the original order, since the SPLICE operator will sort the i/p records based on the positions specified in ON(p,m,f).
There is no other go. icon_redface.gif
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 Oct 16, 2007 9:09 pm
Reply with quote

Quote:
other than by giving the rec count and sorting it again, is there any other method to rtain the order of the record after splicing it.


That's difficult to say since we don't know what your input records or output records look like.

Show an example of the records (relevant fields) in each input file and what you want for output. Give the RECFM and LRECL of the input files. Give the starting position, length and format of the relevant fields.
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
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts VB File comparison JCL & VSAM 1
No new posts Sorting a record spanned over multipl... DFSORT/ICETOOL 13
This topic is locked: you cannot edit posts or make replies. Splice JCL into one record for DD sta... SYNCSORT 2
Search our Forums:

Back to Top