Page 1 of 1

comapring two files

Posted: Wed Feb 11, 2009 2:19 am
by Migul
Can anyone please help me with this query..I am new to all this utilities ..Can you please help me with example of code.

I have two input file each of FB and Record length of 80 as below
File 1
11111111
file 2
ASJGHJLHJHTR11111111AHSKLGFJL
I want to comapre the record in file 1 starting at 1 with the record in file2 starting at 12 and if both are equal then send that record to output file. So in this case the output file should be

Output file
ASJGHJLHJHTR11111111AHSKLGFJL

How can I get this done in batch command.
Can i use compare if yes how??

please help me I really need this code.

Thanks in advance

Posted: Tue Mar 03, 2009 8:45 am
by sharadgarg123
U can compare two files by going to the ISPF menu and selecting the option of Compare( 10) from there and additionally u can set the selection criteria for recordsets that have to be compared.

Posted: Tue Jul 14, 2009 5:55 pm
by Dave E
Hi,

File-AID/MVS has got a very powerful Compare function built-in. You can actually use you record layouts (COBOL or PL/1) and tell File-AID to compare specific fields. For example, if the 1111111 that you mentioned was a customer-id field in one file and a cust-id field in the other file, you can tell File-AID to compare the two fields, even if they are at different offsets within their respective record layouts.

The output criteria allows you to copy the entire record (from any of the input files) to another file. You are able to extract records based on whether the records matched, were deleted, were inserted or simply changed.

Once you use this compare you will never want to use the ISPF compare utility.

Good luck.