I have been asked to create a program that will generate a summary with three report breaks. The breaks should be Field A > Field B > Field C(see below).
My problem is that the program I'm using takes up a lot of system resource and time to generate the report. I had to end the jobs before it finished its run because of the performance issues. The input file I'm using has 9000+ records and has already been sorted according to the breaks mentioned above.
This is the Input:
A B C <- column name
A11,PTM,1399 , .040-
A11,PTM,1399 , 2,220,154.090
A11,PTM,1399 , .190-
A11,PTM,1399 , .010-
E11,PTM,1554 , 42.540
E11,PTM,1554 , 11.280-
E11,PTM,1554 , 19.790
G11,PTM,1502 , .100-
G11,PTM,1502 , .080
G11,PTM,1502 , .350-
G11,PTM,1502 , .390-
Output should look like this:
A11,PTM,1380 , 176655.310
A11,PTM,1399 , 2025805.960
E11,PTM,1554 , 113.280
E11,PTM,1577 , 3392.580
G11,PTM,1411 , .010
Here's the code I'm using:
C READ input LR
/FREE
DOW NOT %EOF;
/END-FREE
C MOVE A A1
C MOVE B B1
C MOVE C C1
C Z-ADD 0 SUM
/FREE
DOW A = A1;
DOW B = B1;
DOW C = C1;
SUM = SUM + AMT;
/END-FREE
C READ input LR
/FREE
ENDDO;
EXCEPT #DET;
EXCEPT #SKIP;
/END-FREE
C MOVE C C1
C MOVE B B1
C MOVE A A1
C MOVE AMT SUM
C READ input LR
/FREE
ENDDO;
EXCEPT #DET;
EXCEPT #SKIP;
/END-FREE
C MOVE C C1
C MOVE B B1
C MOVE A A1
C MOVE AMT SUM
C READ input LR
/FREE
ENDDO;
EXCEPT #DET;
EXCEPT #SKIP;
/END-FREE
C MOVE C C1
C MOVE B B1
C MOVE A A1
C MOVE AMT SUM
C READ input
/FREE
ENDDO;
/END-FREE
*
How can I make processing faster and more efficient? Reducing the size of the input file does not seem to work.
My problem is that the program I'm using takes up a lot of system resource and time to generate the report. I had to end the jobs before it finished its run because of the performance issues. The input file I'm using has 9000+ records and has already been sorted according to the breaks mentioned above.
This is the Input:
A B C <- column name
A11,PTM,1399 , .040-
A11,PTM,1399 , 2,220,154.090
A11,PTM,1399 , .190-
A11,PTM,1399 , .010-
E11,PTM,1554 , 42.540
E11,PTM,1554 , 11.280-
E11,PTM,1554 , 19.790
G11,PTM,1502 , .100-
G11,PTM,1502 , .080
G11,PTM,1502 , .350-
G11,PTM,1502 , .390-
Output should look like this:
A11,PTM,1380 , 176655.310
A11,PTM,1399 , 2025805.960
E11,PTM,1554 , 113.280
E11,PTM,1577 , 3392.580
G11,PTM,1411 , .010
Here's the code I'm using:
C READ input LR
/FREE
DOW NOT %EOF;
/END-FREE
C MOVE A A1
C MOVE B B1
C MOVE C C1
C Z-ADD 0 SUM
/FREE
DOW A = A1;
DOW B = B1;
DOW C = C1;
SUM = SUM + AMT;
/END-FREE
C READ input LR
/FREE
ENDDO;
EXCEPT #DET;
EXCEPT #SKIP;
/END-FREE
C MOVE C C1
C MOVE B B1
C MOVE A A1
C MOVE AMT SUM
C READ input LR
/FREE
ENDDO;
EXCEPT #DET;
EXCEPT #SKIP;
/END-FREE
C MOVE C C1
C MOVE B B1
C MOVE A A1
C MOVE AMT SUM
C READ input LR
/FREE
ENDDO;
EXCEPT #DET;
EXCEPT #SKIP;
/END-FREE
C MOVE C C1
C MOVE B B1
C MOVE A A1
C MOVE AMT SUM
C READ input
/FREE
ENDDO;
/END-FREE
*
How can I make processing faster and more efficient? Reducing the size of the input file does not seem to work.