Modified Program Using Speed Demon. Robelle Suprtool 5.7
Reklama
Reklama
05-report-control section.
move false-value to end-of-d-sales-flag.
perform 10-read-and-report
thru 10-read-and-report-exit
until end-of-d-sales.
05-report-control-exit. exit.
10-read-and-report section.
perform 10-10-get-d-sales.
if not end-of-d-sales then
if dsa-sales-total > 10000 then
perform 20-report-d-sales
thru 20-report-d-sales-exit.
go to 10-read-and-report-exit.
10-10-get-d-sales.
call "DBGET" using db-base
db-set-d-sales
db-mode2
db-status-area
db-all-list
db-buffer-d-sales
db-dummy-arg.
if db-end-of-file then
move true-value to end-of-d-sales-flag
else
if not db-stat-ok then
perform 99-image-fatal-error.
10-read-and-report-exit. exit.
Modified Program Using Speed Demon
You would modify the original code to use Speed Demon to serially read through the d-sales dataset. The original report-control section had no initializing paragraph because we assumed that the d-sales dataset was rewound to the beginning. The modified code must call SPDEDBINIT before reading the dataset. When we have finished reading the dataset, we finish off with a call to SPDEDBSHUT.
436 • Accessing Speed Demon
Suprtool 5.7 for MPE
Suprtool 5.7 for MPE
05-report-control section.
perform 05-05-init-d-sales.
move false-value to end-of-d-sales-flag.
perform 10-read-and-report
thru 10-read-and-report-exit
until end-of-d-sales.
perform 05-20-close-d-sales.
go to 05-report-control-exit.
05-05-init-d-sales.
call "SPDEDBINIT" using db-base
db-set-d-sales
db-mode1
db-status-area
spde-db-control
db-dummy-arg.
if not db-stat-ok then
perform 98-spde-error.
05-20-close-d-sales.
call "SPDEDBSHUT" using db-base
db-set-d-sales
db-mode1
db-status-area
db-dummy-arg.
if not db-stat-ok then
perform 98-spde-fatal-error.
05-report-control-exit. exit.
The read-and-report section has one change. Calls to DBGET are replaced with calls to SPDEDBSCAN. If SPDEDBSCAN fails, we perform a different error section.
Note that the parameter list for SPDEDBSCAN is not the same as for DBGET. Our original program used the @-list, so we don't need to make any changes to the buffer-d-sales declaration.
10-read-and-report section.
perform 10-10-read-d-sales
if not end-of-d-sales then
if dsa-sales-total > 10000 then
perform 20-report-d-sales
thru 20-report-d-sales-exit.
go to 10-read-and-report-exit.
10-10-read-d-sales.
call "SPDEDBSCAN" using db-base
db-status-area
db-buffer-d-sales
db-dummy-arg.
if db-end-of-file then
move true-value to end-of-d-sales-flag
else
if not db-stat-ok then
perform 98-spde-error.
10-read-and-report-exit. exit.
If the original program used partial field lists, we would call SPDEDBINIT with mode-2 and pass the field list as the last parameter. For example,
Accessing Speed Demon • 437
Atsisiųsti
Reklama