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 How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm


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