Posted: Wed Apr 22, 2009 2:32 pm Post subject: Compare blocks of data
Hi All,
I need to compare blocks of records based on the rules given below.
Example
Record lenght : 80 bytes :
Dept NUM start pos : 22
Rule :
- Compare the 1st 3 character from both the files. If they match.
- Compare the Dept num. ( which is always in the AB100 card). If it matches.
- compare all other fields in the AB*** records. If they dont match , mark such records and output them
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Apr 22, 2009 2:44 pm Post subject:
Martin,
1. What is the expected output from the above?
2. What do you mean by Blocks of data? isnt it comparing record by record?. If the first 3 bytes are the key , how do you map which record is to be compared from second file?
Like ABC00 should be compared with ABC00 or it should be compared with all of the ABC records from file2?
4.How do you distinguish the start and end of each group? _________________ Kolusu
www.linkedin.com/in/kolusu
1 . Output will contain the entire block of records. ( both from file 1 and file 2)
2. I need to compare all the AB*** records only when 1st 3 digits and the dept num match.
3. Yes... corresponding ABC00 should be compared.
4. Start is ABC00 record and end id AB102 record
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri Apr 24, 2009 6:32 pm Post subject:
Martin,
The following DFSORT JCL will give you the desired results
Brief explanation of the job.
1. STEP0100 & STEP0200 both will tag the DEPT NUM which is present on the AB100 to at the end of every record for each block in each file
2. Now concatenate these 2 files together and sort on the deptnum as key and the whole 80 bytes . By doing so we will merge if the records are the same from both the files.
3. The last pass is checking if there is no match in any one of the records within a group, if differences are found we will write out the records. Pos 81-82 will F1 denoting it is File1 record and F2 deonotes File2 record
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum