506 Using IBM Application Development Tools for z/OS and OS/390
Because the customer has one record for every company in which he holds shares, the
program logic must be changed to check only the CUST-NM of KEYREC. Saving the CUST-NM field
of KEYREC and checking it just after a READ NEXT should solve the problem.
The changes you make to the program are (the corrected ‘after lines’ were commented out):
Before (line 712)
MOVE KEYREC OF CUSTOMER-IO-BUFFER TO WS-CUST-KEY
After (line 713)
MOVE CUST-NM OF CUSTOMER-IO-BUFFER TO WS-CUST-NM
Before (line 723, 724)
PERFORM CALCULATE-SHARE-vaLUE
UNTIL KEYREC OF CUSTOMER-IO-BUFFER NOT EQUAL
WS-CUST-KEY.
After (line 721, 722)
PERFORM CALCULATE-SHARE-vaLUE
UNTIL CUST-NM OF CUSTOMER-IO-BUFFER NOT EQUAL
WS-CUST-NM.
Before (line 738)
MOVE CUST-NM OF CUSTOMER-IO-BUFFER TO WS-CUST-NM
After (line 737)
MOVE KEYREC OF CUSTOMER-IO-BUFFER TO WS-CUST-KEY
27.3.3 Executing the batch application after the fix
You finish correcting the program logic in TRADERB and you recompile the program.
Submit the batch job, TRADER.
This results in a successful execution, and the report shown in Example 27-15 is displayed.
Example 27-15 Successful output of TRADERB following program changes
CUSTOMER : RB_DEMO 10/01/2002
-----------------------------------------------------------------
COMPANY SHARES SHARE TOTAL
HELD vaLUE COST
-----------------------------------------------------------------
Glass_and_Luget_plc 120 19.00 2,280.00
IBM 2400 163.00 391,200.00
Veck_Transport 1350 36.00 48,600.00
27.4 Summary of scenario 2
In this chapter we described the various components that make up the batch environment in
our system and how they are set up.
We reviewed these topics:
򐂰 The processing performed by the batch Trader application
򐂰 A process that used Debug Tool in batch mode to identify a possible problem in the
application
򐂰 Debug Tools capability in foreground mode to pinpoint an error to allow it to be corrected

Get Using IBM Application Development Tools for z/OS and OS/390 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.