Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Compare 2 files, excluding cetain fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Compare 2 files, excluding cetain fields
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    Post subject: Reply to: Compare 2 files, excluding cetain fields
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us