Sorry Guys for not being able to explain in one of my earlier post.
I am now putting my requirement with the input file and desired output file.
In the below input file -
Transaction code is at position 31:40.
Business code is from position 318:321
TSCM00000005837 CM0002N -0000000001906.072010-12-10XML MM 201002081000000 YORK
003007XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM00000008112 CM0002N -0000000001906.072010-12-10XML MM 201002081000000 YORK
007777XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM80000005282 CM0019NM +0000000002254.982010-12-10XML MM 201002081000001 YORK
000440XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM00000000215 CM0019NM +0000400002254.982010-12-10XML MM 201002081000001 YORK
000500XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM00000000215 CN0001N -0000400002254.982010-12-10XML MM 201002081000001 YORK
000292XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM80000005282 CN0001N -0000400002254.982010-12-10XML MM 201002081000001 YORK
007843XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM00000008107 CN0001N -0000400002254.982010-12-10XML MM 201002081000001 YORK
000012XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM00000008093 CN0001P -0000400002254.982010-12-10XML MM 201002081000001 YORK
000379XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM00000002646 CN0001P -0000400002254.982010-12-10XML MM 201002081000001 YORK
007847XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM00000002646 CN0001P -0000400002254.982010-12-10XML MM 201002081000001 YORK
003400XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
For record 1-10 the combination of transaction code and business code is as following-
CM0002N - 3007
CM0002N - 7777
CM0019NM + 0440
CM0019NM + 0500
CN0001N - 0292
CN0001N - 7843
CN0001N - 0012
CN0001P - 0379
CN0001P - 7847
CN0001P - 3400
Further we have got a condition file which is having 3 values (comma separated file)
The first value is business code, second is transaction code and third is derived transaction code. The file is given below
3007,CM0002N -,CMCAMTN -
3037,CM0002N -,CMCAMTN -
3059,CM0002N -,CMCAMTN -
3007,CM0002N +,CMCAMTN +
3037,CM0002N +,CMCAMTN +
3059,CM0002N +,CMCAMTN +
3007,CM0002P -,CMCAMTP -
3037,CM0002P -,CMCAMTP -
3059,CM0002P -,CMCAMTP -
3007,CM0002P +,CMCAMTP +
3037,CM0002P +,CMCAMTP +
3059,CM0002P +,CMCAMTP +
0440,CM0019N -,CMDDPTN -
0440,CM0019N +,CMDDPTN +
0440,CM0019NM -,CMDDPTNM -
0440,CM0019NM +,CMDDPTNM +
0292,CN0001N -,CNQCSHN -
0379,CN0001N -,CNQCSHN -
1038,CN0001N -,CNQCSHN -
7810,CN0001N -,CNQCSHN -
7811,CN0001N -,CNQCSHN -
7812,CN0001N -,CNQCSHN -
7842,CN0001N -,CNQCSHN -
7843,CN0001N -,CNQCSHN -
0292,CN0001N +,CNQCSHN +
0379,CN0001N +,CNQCSHN +
1038,CN0001N +,CNQCSHN +
7810,CN0001N +,CNQCSHN +
7811,CN0001N +,CNQCSHN +
7812,CN0001N +,CNQCSHN +
7842,CN0001N +,CNQCSHN +
7843,CN0001N +,CNQCSHN +
0292,CN0001P -,CNQCSHP -
0379,CN0001P -,CNQCSHP -
1038,CN0001P -,CNQCSHP -
7810,CN0001P -,CNQCSHP -
7811,CN0001P -,CNQCSHP -
7812,CN0001P -,CNQCSHP -
7842,CN0001P -,CNQCSHP -
7843,CN0001P -,CNQCSHP -
7719,CN0001P -,CNCSHBP -
7800,CN0001P -,CNCSHBP -
7801,CN0001P -,CNCSHBP -
7802,CN0001P -,CNCSHBP -
7830,CN0001P -,CNCSHBP -
7831,CN0001P -,CNCSHBP -
7846,CN0001P -,CNCSHBP -
7847,CN0001P -,CNCSHBP -
The requirement is-
Check the business code and transaction code from the input file.
Compare the values with the conditions given in condition file. If the business code (position 31:40) and transaction code (position 318:321) matches with the first and second value of any record in condition file, replace the transaction code with the third value of condition sheet.
After running the command/script the output file should be like this (Change in transaction code, position 318:321 wherever condition is met)
TSCM00000005837 CMCAMTN -0000000001906.072010-12-10XML MM 201002081000000 YORK
003007XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM00000008112 CM0002N -0000000001906.072010-12-10XML MM 201002081000000 YORK
007777XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM80000005282 CMDDPTNM +0000000002254.982010-12-10XML MM 201002081000001 YORK
000440XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM00000000215 CM0019NM +0000400002254.982010-12-10XML MM 201002081000001 YORK
000500XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM00000000215 CNQCSHN -0000400002254.982010-12-10XML MM 201002081000001 YORK
000292XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM80000005282 CNQCSHN -0000400002254.982010-12-10XML MM 201002081000001 YORK
007843XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM00000008107 CN0001N -0000400002254.982010-12-10XML MM 201002081000001 YORK
000012XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM00000008093 CNQCSHP -0000400002254.982010-12-10XML MM 201002081000001 YORK
000379XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM00000002646 CNCSHBP -0000400002254.982010-12-10XML MM 201002081000001 YORK
007847XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
TSCM00000002646 CN0001P -0000400002254.982010-12-10XML MM 201002081000001 YORK
003400XML MM 2010000000000* 00000000*
2010-12-10-00.00.00123456789123450 GB 5045
~
My Input file is having around 1 million records and these needs to be checked against all the conditions in condition sheet.