Home > Archive > Cobol > March 2004 > Report Writer control behavior
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Report Writer control behavior
|
|
| B Hobbs 2004-03-28, 9:50 pm |
| VMS 7.3 COBOL 2.7
I'm trying to figure out if this is a bug or this is the way Report
Writer controls are supposed to work.
Command procedure with source:
http://eisner.encompasserve.org/~ho...-CONTROL-01.COM
Output of the above:
http://eisner.encompasserve.org/~ho...-CONTROL-01.LOG
At the bottom of the log file, look between the "*** begin ***" and
"*** end ***" lines. In the first set, notice that A is paired with
bravo, B with charlie, ... In the second set, A is paired with alpha,
B with bravo, ... Scroll up in the log file, look at source lines 41
and 50 along with the rest of the code.
I'm curious how other COBOL compilers behave.
| |
|
|
| Lueko Willms 2004-03-28, 9:50 pm |
| Xref: kermit comp.lang.cobol:86426
Am 27.03.04
schrieb bdhobbs18@yahoo.com (B Hobbs)
auf /COMP/LANG/COBOL
in e86c07c4.0403272229.2632c738@posting.google.com
ueber Report Writer control behavior
BH> At the bottom of the log file, look between the "*** begin ***" and
BH> "*** end ***" lines. In the first set, notice that A is paired with
BH> bravo, B with charlie, ... In the second set, A is paired with
BH> alpha, B with bravo, ... Scroll up in the log file, look at source
BH> lines 41 and 50 along with the rest of the code.
Unfortunately I could not check out your example program since the
compiler I have installed does not support the Report Writer module
(until today I thought, it would).
here are some parts of your program.
Comment No. 1: if you want summary reporting, you can use
GENERATE <report-name>
instead of
GENERATE <detail-name>
Comment No. 2:
If the lines you want to see on your listing are just the CONTROL
FOOTINGS, you will see displayed the control item governing this
control, but other items configured for that line, like the one
SOURCE DATA-MNEMONIC
which does not reference a control item, will use as source the
CURRENT value of that data item AT THE TIME this control footing is
produced.
And it is produced when the control item has been replaced by a
value different from the one which is summarized in this control
footing.
That's why I think the behaviour of your REPORT-1 is correct and as
should be expected.
Since you configured the data item DATA-MNEMONIC as a control item
in REPORT-2, the program will provide a separate storage for this
control item, to find out if the current value has changed. Obviously,
the compiler arranges for using this control value in the control
footing, since it is configured as a subordinate control, instead of
the current value of the data item AFTER the change in the primary
control item.
I hope that helps...
Yours,
L. Willms
01 data-report.
11 data-letter pic x.
11 pic x.
11 data-mnemonic pic x(8).
01 one pic 9 comp value 1.
report section.
rd report-1 control data-letter.
01 detail-1 type detail.
01 footing-1 type control footing data-letter.
11 line plus 1.
21 column 1 pic x source data-letter.
21 column 5 pic x(8) source data-mnemonic.
21 column 16 pic zz9 sum one.
* Add data-mnemonic to control list.
rd report-2 control data-letter data-mnemonic.
01 detail-2 type detail.
01 footing-2 type control footing data-letter.
11 line plus 1.
21 column 1 pic x source data-letter.
21 column 5 pic x(8) source data-mnemonic.
21 column 16 pic zz9 sum one.
procedure division.
initiate report-1.
perform varying i from 1 by 1 until i > 12
move data-in(i) to data-report
generate detail-1
end-perform.
terminate report-1.
initiate report-2.
perform varying i from 1 by 1 until i > 12
move data-in(i) to data-report
generate detail-2
end-perform.
terminate report-2.
|
|
|
|
|