Hi All,
I have Two files as input
FILE1
DATA1 1 8 A
FILE2
DATA2 1 8 A
QUANTITY 9 5 A
INDICATOR 14 1 A
FILE3
DATA3 1 8 A
QUANTITY3 9 5 A
IN FILE1 I HAVE RECORDS AS FOLLOW
ITEM1
ITEM2
ITEM3
IN FILE2 I HAVE RECORDS AS THERE IS NO LIMIT FOR OCCURENCES OF THE EACH RECORD I MEAN DUPLICATE IS ALLOWED.
ITEM1 10 P
ITEM1 5 P
ITEM1 2 P
ITEM2 10 P
ITEM3 1 P
ITEM3 2 P
ITEM3 1 U
ITEM3 6 P
BELOW IS REQUIREMENTS:
GET RECORD FROM FILE1
I.,E. ITEM1 READ AGAINST FILE2 AN ADD THE QUANTITY WHERE INDICATOR IS 'P' AGAINST ITEM1
AND WRITE TO SUM TO FILE3 QUANTITY
IF ONLY ONE RECORD IS MATCHING FROM FILE1 TO FILE2 WRITE THAT ALONE WITH QUANITY FROM FILE2
SIMILARY READ FILE1 GET ITEM3 AND SUM THE QUANITY AGAINST IND 'P' WRITE FILE3
IN FILE 3 THERE SHOULD BE ONLY ONE ENTRY PER RECORD.
I AM LOOKING FOR THE HELP TO WRITE CODE, WHAT WORK-VARIABLES NEEDS TO BE DEFINED AND HOW WE CAN SUM THESE QUANITY USING EAZYTRIEVE AND WRITE THE TOTAL SUM OF VALUES.
PLEASE HELP ME