I have follwing requiremt in cobol.
input file
country PIC X(2)
Branch No PIC X(2)
Customer No PIC X(5)
order number PIC X(8)
AMT PIC S9(15)V99 COMP-3
Date-1 PIC S9(05) COMP-3
Date-2 PIC S9(05) COMP-3
NET-pay PIC S9(15)V99 COMP-3
Now i have requirement in code
if country code( row1,row2....rown) = ws-country code (row2....rown)
Customer No ( row1,row2....rown) = Ws-Customer No( row2,row3....rown)
order number( row1,row2....rown) = WS-order number(( row2,row3....rown)
compute Net Pay = order number(row1) + ws-order number
else order number = orginal order number
some example :
Branch No Date-1 Customer No Date-2 order number AMT Net -pay Net-value
7 08/01/09 puneet 123 13/10/08 07-08001-17 429163.35 429163.4 429163.4
7 08/01/09 puneet 123 13/10/08 07-C6279-62 -413825 -413825 0
7 08/01/09 puneet 123 13/10/08 07-C6279-62 219284.87 -194540 0
7 08/01/09 puneet 123 13/10/08 07-C3555-69 -300 -300 0
7 08/01/09 puneet 123 13/10/08 07-08001-17 429163.35 429163.4 429163.4
7 08/01/09 puneet 123 13/10/08 07-C6279-62 -413825 -413825 0
7 08/01/09 puneet 123 13/10/08 07-C6279-62 219284.87 -194540 0
7 08/01/09 puneet 123 13/10/08 07-C3555-69 -300 -300 0
in this query main calculation is net pay and net value
net pay is calcultaed if branch no(row1..rown) = branch(row2....rown) and customer no(row1..rown)=customer no(row2..rown) and order number (row1..rown) = order number (row2..rown)
refer above example