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

Compare 2 files, excluding cetain fields


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

New User


Joined: 24 Mar 2012
Posts: 17
Location: pune

PostPosted: Sat Sep 08, 2012 2:19 am
Reply with quote

Hi,

I have below requirement:
File 1:
Record length - 600
Record fomat - FB
say sample record -
Code:
123456ABCDE78901
234567FGHIJ79012
098765ASDFL12345

File 2:

Record length - 650
Record fomat - FB
say sample record -
Code:
123456&^$ABCDE78901%$@
234567&%#FGHIJ79012*@#
246765&*&ASDFL12345$%$




Here we can see that in file 2 we have extra fields from 7 to 9 and 20 to 22.

I have to find out the records those are same and different in file1 and file 2 after ignoring extra fields.
As we can see the 3rd record is different in file 2 from file 1 even we ignore extra fields value(e.g &*& and $%$)

Thanks!
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat Sep 08, 2012 3:00 am
Reply with quote

Ravi Kirti,

Use the following DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                   
//SYSOUT   DD SYSOUT=*                     
//INA      DD DISP=SHR,DSN=Your Input FB 650 byte file
//INB      DD DISP=SHR,DSN=Your Input FB 600 byte file
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD *                           
  OPTION COPY                             
  JOINKEYS F1=INA,FIELDS=(1,6,A,10,10,A)   
  JOINKEYS F2=INB,FIELDS=(1,6,A,07,10,A)   
  JOIN UNPAIRED,F1,ONLY                   
//*
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
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top