Page 1 of 1

File matching logic

PostPosted: Sat Feb 11, 2012 12:13 am
by kiran_wiproblr
Hi All,

Could you please help me out?

Could some one know sort card for below requirement please help me out

I have 2 input file one is transaction file (File-1) and master file (File-2)
Lay out as below
File-1 (transaction file)
1-5      7-10    12-16
F1C1     F1C2    F1C3
X(5)     X(4)    X(5)

File-2 (master file)
1-5       7-10    12-16    18-24  26-30
F2C1      F2C2    F2C3     F2C4    F2C5


If (F1C1=F2C1 AND F1C2=F2C2 AND F1C3=F2C3)
Then out put file has to fill with F2C1 F2C2 F2C3 F2C4 F2C5
Else depending up on condition
Display F1C1 is not matched
Display F1C2 is not matched
Display F1C3 is not matched and abend the job

Regards,
Kiran

Re: File matching logic

PostPosted: Sun Feb 12, 2012 4:41 am
by BillyBoyo
I'm not sure I'm clear on this. The match is easy, a JOINKEYS.

IF F1C1 not on file, might make some sense. But what do you mean about F1C2? Do you mean if there is no value of that "secondary" key anyhere on the file, or just under F1C1? Similar question with F1C3.

Can you have the situation where a key consisting of all three fields would be duplicate on either file? If so, what then?

So, the main part JOINKEYS with REFORMAT. It would be possible to include the F1C1 test at the same time, but unless there is no direct connection between the elements of the keys, the other tests don't seem to make sense. Keys matched, fields out. Major key not matched, abend. Whole key not matched, abend. The "minor" parts of the keys can be done, if you can reasobably explain how your data requires that.

Re: File matching logic

PostPosted: Mon Feb 13, 2012 11:41 pm
by kiran_wiproblr
Can some one please help me out?
Below is my requirement.

Senario 1:
If field 1,2,3 of transaction file is equals to master file,
then respective recorded in master file has to write into output data set

Transaction file
----+----1----+
AAAA1 BBB1 CCC1
AAAA2 BBB2 CCC2
AAAA3 BBB3 CCC3


Master File
----+----1----+----2----+
AAAA1 BBB1 CCC1 XXX1 YYY1
AAAA2 BBB2 CCC2 XXX2 YYY2
AAAA3 BBB3 CCC3 XXX3 YYY3

Expected Output:
----+----1----+----2----+
AAAA1 BBB1 CCC1 XXX1 YYY1
AAAA2 BBB2 CCC2 XXX2 YYY2
AAAA3 BBB3 CCC3 XXX3 YYY3

=======================================
Senario 2:
If field 1 of transaction file is NOT equals to master file-filed1, then
job has to abend and message has to display as "AAAA4 is not there in master fie"

Transaction file
----+----1----+
AAAA1 BBB1 CCC1
AAAA2 BBB2 CCC2
AAAA3 BBB3 CCC3
AAAA4 BBB1 CCC1

Master File
----+----1----+----2----+
AAAA1 BBB1 CCC1 XXX1 YYY1
AAAA2 BBB2 CCC2 XXX2 YYY2
AAAA3 BBB3 CCC3 XXX3 YYY3

Expected Output:
Job has to abend and has to displaying mesage
"AAAA4 is not there in master fie"

========================================
Senario 3:
If field 2 of transaction file is NOT equals to master file-filed2,
then job has to abend and message has to display as "BBB5 is not there for AAAA1 in master fie"

Transaction file
----+----1----+
AAAA1 BBB1 CCC1
AAAA2 BBB2 CCC2
AAAA3 BBB3 CCC3
AAAA1 BBB5 CCC1

Master File
----+----1----+----2----+
AAAA1 BBB1 CCC1 XXX1 YYY1
AAAA2 BBB2 CCC2 XXX2 YYY2
AAAA3 BBB3 CCC3 XXX3 YYY3

Expected Output:
Job has to abend and has to displaying mesage
"BBB5 is not there for AAAA1 in master fie"

==============================================
Senario 4:
If field 3 of transaction file is NOT equals to master file-filed3,
then job has to abend and message has to display as " CCC6 is not there for AAAA1 in master fie"

Transaction file
----+----1----+
AAAA1 BBB1 CCC1
AAAA2 BBB2 CCC2
AAAA3 BBB3 CCC3
AAAA1 BBB1 CCC6

Master File
----+----1----+----2----+
AAAA1 BBB1 CCC1 XXX1 YYY1
AAAA2 BBB2 CCC2 XXX2 YYY2
AAAA3 BBB3 CCC3 XXX3 YYY3

Expected Output:

Job has to abend and has to displaying mesage
"CCC6 is not there for AAAA1 in master fie"

Re: File matching logic

PostPosted: Tue Feb 14, 2012 12:35 am
by BillyBoyo
What's the little complaint for? I'm trying to help, but no one can do anything until the requirement is clear anyway.

Three Keys, A B and C.

If A value does not exist at all on Masterfile, abend with message for A

If A value does exist, but B value does not exist within A value, abend with message for B

If A and B value do exist, but C value does not exist with A and B value combination, abend with message for C

Or,

If A value does not exist at all on Masterfile, abend with message for A

If B value does not exist at all on Masterfile, abend with message for B

If C value does not exist at all on Masterfile, abend with message for C


I'd expect the first, but don't want to go down that route if it turns out to be the second.

Re: File matching logic

PostPosted: Tue Feb 14, 2012 8:45 pm
by kiran_wiproblr
Would some one help me out?

In my data set one record occupies 3 rows (3 rows=1 recorded)

Key starts on 2nd position,
If key matches with input file then I want some numeric data which is there next to next line (last line/3rd row of the record) from 13th position to 20th position, say FIELD-A

Expected output is
FIELD-A yesterdays date(mm/dd/yy)

Input
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
.KEY1111 SOME-1 TEXT..............
SOME-2 TEXT......................                                                  .
SOME-3 TEXT 11.22.33.
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
.KEY1111 SOME-4 TEXT...............
SOME-5 TEXT..............                                                 .
SOME-6 TEXT 44.55.66.


Expected output is
11.22.33  02/13/12
44.55.66  02/13/12


In my data set one record occupies 3 rows (3 rows=1 recorded)

Key starts on 2nd position,
If key matches then I want some numeric data which is there next to next line (lastline/3rd row of the record)
from 13th position to 20th position, say FIELD-A

Expected output is
FIELD-A yesterdays date(mm/dd/yy)

Re: File matching logic

PostPosted: Tue Feb 14, 2012 8:59 pm
by Akatsukami
kiran_wiproblr wrote:Would some one help me out?

No.

Re: File matching logic

PostPosted: Wed Feb 15, 2012 1:09 pm
by bodatrinadh
Kiran,

Request you to start a new topic for your second question. Multiple questions will lead to confusion.

Thanks
-3nadh