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 

FILE comparision using ICETOOL or SYNC Sort

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


Joined: 04 Aug 2005
Posts: 41
Topics: 16

PostPosted: Wed May 04, 2011 11:58 am    Post subject: FILE comparision using ICETOOL or SYNC Sort Reply with quote

I have a requirement where in I need to compare file-1,file-2 and the output should contain all the records from
file-2 but the records which are not in file-1 or records which are modified in file-1 should be padded with 'xxx' (in position 23-25).

Need a solution using ICETOOL or SYNC SORT.

Code:
File -1

LRECL =  25

ROSHAN GEORGE 20110504
EDWIN  STANLEY20110405



FILE-2
LRECL =  25

ROSHAN GEORGE 20110504
EDWIN  STANLEY20071113 --> this is modified record
RAKESH KUMAR  20070809 --> new record
SURESH BABU   19990621 --> new record



OUTPUT FILE
LRECL =  25


ROSHAN GEORGE 20110504
EDWIN  STANLEY20071113XXX
RAKESH KUMAR  20070809XXX
SURESH BABU   19990621XXX
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed May 04, 2011 12:51 pm    Post subject: Reply with quote

mahesh_chv,

Assuming the key to be matched is 14 bytes the following DFSORT JCL will give you the desired results



Code:

//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//INA      DD DSN=Your Input file1,DISP=SHR
//INB      DD DSN=Your Input file2,DISP=SHR
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                             
  JOINKEYS F1=INA,FIELDS=(1,14,A)                           
  JOINKEYS F2=INB,FIELDS=(1,14,A)                           
  JOIN UNPAIRED                                             
  REFORMAT FIELDS=(F1:1,25,F2:1,33,?)                       
  SORT FIELDS=(51,8,CH,A)                                   
  OUTREC IFOUTLEN=25,                                       
  IFTHEN=(WHEN=(59,1,CH,EQ,C'B',AND,(1,25,CH,EQ,26,25,CH)), 
  BUILD=(1,25)),                                             
  IFTHEN=(WHEN=(59,1,SS,EQ,C'1,B',AND,(1,25,CH,NE,26,25,CH)),
  BUILD=(1,22,3C'X')),                                       
  IFTHEN=(WHEN=(59,1,CH,EQ,C'2'),BUILD=(26,22,3C'X'))       
//JNF2CNTL DD *                                             
  INREC OVERLAY=(26:SEQNUM,8,ZD)                             
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mahesh_chv
Beginner


Joined: 04 Aug 2005
Posts: 41
Topics: 16

PostPosted: Thu May 05, 2011 9:56 pm    Post subject: Reply with quote

Thanks for the solution Kolusu.
But we dont have DFSORT in our shop.
We use SYNC SORT or ICETOOL

Can you please give me a solution using ICETOOL?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu May 05, 2011 10:17 pm    Post subject: Reply with quote

mahesh_chv,

You don't have DFSORT's ICETOOL. You have Syncsort's SYNCTOOL - SYNCTOOL is an ALIAS for ICETOOL. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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