Posted: Thu Oct 18, 2007 4:36 pm Post subject: Comparing the same file records
Hi,
I have one input file VSAM 50 bytes all alphanumeric
fields:
A : 1- 12 can be duplicate
B : 13-21 can be duplicate but for a corresponding 1 - 12 field number, it won't be duplicate
C : 22-40 something (which i want to compare)
D : 41-50 something...
Also, in A field, I want only specific : e.g. AAAA,BBBB,AB,BC. which was easy using INCLUDE COND.
Then, I used SELECT ... ALLDUPS (on A field) to get only the duplicate records with A field and (AAAA,BBBB,AB or AC) in B field.
Plus, the input file is such that if in one record for some A field, B field = AAAA then it will also have one more record for the same A field and B field = BBBB
Similarly the same as B field = AB and BC.
What I need is : say for particular A field it has two records with B field = AAAA and BBBB. I want to compare C field (22-40 bytes) (of these two records). If same, write both the record in output file.
similarly for some particular A field it will have two records with B field = AB and BC. so, want to compare their C fields. If same, write both the records in output file.
I hope I have been able to explain precisely.
I know splice may work (in addition to something else) but not exactly getting how to work out with splice in this requirement.
Joined: 13 Dec 2006 Posts: 101 Topics: 4 Location: india
Posted: Thu Oct 18, 2007 11:47 pm Post subject:
seekaysk
Looks lot many constraints, unfolding your requirement and building a sample i/p file would be difficult by reading your comments.
Better yourself provide a sample i/p file and expected o/p file by considering good amount of cases. _________________ cHEERs
krisprems
As said above... Providing a sample input file and an output file would be helpful. _________________ Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
In short, the input file will have duplicate records (more than one) in 1 - 12 bytes. In the sample file REC1, 3, 4 AND 5 are duplicate and similarly REC2 and REC6. What I want is to compare the records on 21 - 40 bytes (AAAA with BBBB) and similarly (AB with BC)
That means, in this case, I want to compare 21 - 40 bytes of REC1 and REC3. since these bytes match, write both the records to output file.
Similarly, I want to compare 21 - 40 bytes of REc4 and REC5. since these bytes match write both the records to output file.
Similarly, as you can see, 1 - 12 bytes of REC2 and REC6 matches. But comparing their 21-40 bytes, they are not same. so we would not write them to output file. _________________ Thanks.
Joined: 13 Dec 2006 Posts: 101 Topics: 4 Location: india
Posted: Fri Oct 19, 2007 9:00 am Post subject:
seekaysk
You Dont need a SPLICE operator here, SELECT operator would suffice your requirement.
Try this ICETOOL JOB.
This JOB would work untill and unless there are no duplicates from 1-16 bytes.
Hey, i am sorry. I just misunderstood the requirement. the output file should contain the mismatched records.
I believe just changing from ALLDUPS to NODUPS wouldn't work here. As in this case, we need ON(1,12,CH) ON(81,1,CH) to match but ON(21,20,CH) to mismatch.
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