Hello
I have two input files, one (input1) of 570 positions and the other (input2) 30. Both files are sorted ascending by the same key. The first file has no duplicates. The second has duplicates which I will have to do a loop until you change the second file key updating indicators.
input file 1 (570 positions)
------------
field1-a pic x(14)
key1 pic x(6)
field1-b pic x(550)
input file 2 (30 positions)
------------
key2 pic x(6)
amount2-a pic x(6)
amount2-b pic x(6)
amount2-c pic x(6)
amount2-d pic x(6)
I Need to obtain an output file with the content of file 1 and 6 indicators (Y / N), depending on the fields amount2-a, amount2-b,-c amount2, amount2-d.
output file (576 positions)
-----------
field1-a pic x(14)
key1 pic x(6)
field1-b pic x(550)
ind1-a pic x(1)
ind1-b pic x(1)
ind1-c pic x(1)
ind1-d pic x(1)
ind1-e pic x(1)
ind1-f pic x(1)
By default, the 6 indicators (ind1-a, ind1-b, ind1-c, ind1-d, ind1-e, ind1-f) come with "N"
If the field amount2-b = '110065' or '110070' or '110078' write 'Y' in the ind1-a
If the field amount2-a = '300158' write 'Y' in the ind1-b
If the field amount2-b = '100034' or '100035' or '100037 'or '100038' write 'Y' in the ind1-c
If the field amount2-b = '100014' write 'Y' in the ind1-d
If the field amount2-b = '130177' write 'Y' in the ind1-e
If the field amount2-b = '110331' or '110334' or '110335 'or '110336' or '110337' or '110339' write 'Y' in the ind1-f
Failure to meet any of these conditions, the indicators will come with "N".
As you can see the field amount2-c and amount2-d are not used in comparisons
Example
input file1
-----------
xxxxxxxxxxxxxx000001xxxxxxxxx.....
xxxxxxxxxxxxxx000012xxxxxxxxx.....
xxxxxxxxxxxxxx000014xxxxxxxxx.....
xxxxxxxxxxxxxx000031xxxxxxxxx.....
xxxxxxxxxxxxxx000039xxxxxxxxx.....
input file2
-----------
000012301001110071110070110064
000012302580110076110075110064
000014400001130260130263130173
000014301502110073110070110064
000014400001130177130174130173
000031300001110066110065110064
000032400001345683989812348989
000039400001130177130174130173
000039400001130260130263130173
000039300525110067110065110064
output file
-----------
xxxxxxxxxxxxxx000001xxxxxxxxx.....NNNNNN
xxxxxxxxxxxxxx000012xxxxxxxxx.....YNNNNN
xxxxxxxxxxxxxx000014xxxxxxxxx.....YNNNYN
xxxxxxxxxxxxxx000031xxxxxxxxx.....YNNNNN
xxxxxxxxxxxxxx000039xxxxxxxxx.....YNNNYN
I see (at manual) that can be used IFTHEN, WHEN, OVERLAY and HIT=NEXT but I don't know how to use. Could you help me?
thanks for your help.
sorry if, perhaps, I have not properly explained
Pulcinella