Page 1 of 1

Compare two VB files and key has both packed and zoned decim

PostPosted: Fri Mar 04, 2011 7:59 pm
by jaganmoni
Hi,

I am looking for help on the below query.
File1: Current day file
File2: Previous day file
I have two variable block files (current day and previous day) and the LRECL is 600.
File1: Current day file
File2: Previous day file
The key value starts from column 1 to 11.
This key has both packed data and zoned decimal data. I have to compare both the files only if the key has 140 in last two bytes of key.
In the below given example the first three records key is ending with 140 and the fourth record key is ending with 050.
If we have matching records (only for the keys which ends with 140) in both the files then I have two write this matching record in output file only if the value in 49th position is mismatch.
Code:
----+----1----+----2----+----3----+----4----+----5----+
.......51........0530971350021138511000000....&.,000000
0310003FF10000000FFFFFFFFFFFFFFFFFFFFFFFFF0002504FFFFFF
03C001C514C00500C053097135002113851100000000770C0000000
,------------------------------------------------------
.......52........0303951350021420001000000...n.. 000000
0310003FF10001000FFFFFFFFFFFFFFFFFFFFFFFFF0019004FFFFFF
03C001C524C00200C030395135002142000100000000150C0000000
,------------------------------------------------------
.......53........0303951350021420455033106...n.. 000000
0310003FF10000000FFFFFFFFFFFFFFFFFFFFFFFFF0019004FFFFFF
03C001C534C00500C030395135002142045503310600250C0000000
,------------------------------------------------------
......ð00............&.............DEEMED RISK NN...
0310008FF00000000001250000000000000CCCDCC4DCED444DD0314
03C001C005C00000C00010C00000C00000C455454099220005503C0
,------------------------------------------------------
......ð51........0530971999521138511000000....&. 000000
0310008FF10001000FFFFFFFFFFFFFFFFFFFFFFFFF0012504FFFFFF
03C001C514C00000C053097199952113851100000000010C0000000

Re: Compare two VB files and key has both packed and zoned d

PostPosted: Sat Mar 05, 2011 12:46 am
by dick scherrer
Hello,

Do not post your questions on multiple forums.

The "other" one has been deleted.

d

Re: Compare two VB files and key has both packed and zoned d

PostPosted: Sat Mar 05, 2011 2:33 am
by Frank Yaeger
Some questions:

What is the RECFM of your input files? You say "variable block files", but your example does not show the RDW. Are the records really VB?

Are you trying to match the two files by key, or record-by-record?

Please show a better example of the records in each input file and what you expect for output.

If you are matching by key: Can file1 have duplicate records within it? Can file2 have duplicate records within it? If so, show that in your example.

Feel free to represent your example records in EBCDIC rather than hex with just the relevant fields (key and position 49), e.g.

keyaa140  A
keybb140  B