Re: READING 2 RECS before write to PRINT REC
- From: jeff@xxxxxxxxxx
- Date: 21 Aug 2006 07:03:42 -0700
Thanks DD. Here is how it is accomplished now. It reads a work file I
created and just prints the records, I will need to change the
structure on how to accomplish this. That is where I am stuck.
format-print-report.
perform report-initialization.
move '00000000000' to slscompwk-key slscompwk-key-2.
move "N" to ws-slscompwk-EOF.
perform start-slscompwk-file-nlt-2.
perform rd-slscompwk-file-next.
perform build-report-detail
until slscompwk-EOF.
perform fmt-rpt-totals-line.
perform print-rpt-totals.
perform print-end-of-report.
report-initialization.
move ws-store-no to rpt-parm-store-no.
move "Date: " to rpt-parm-type-1,
rpt-parm-type-2.
perform print-std-rpt-hdr.
perform print-legend.
perform print-rpt-parameter-hdrs.
perform print-rpt-col-hdrs.
build-report-detail.
perform format-print-detail-record.
perform print-rpt-detail-line.
if spacer-count = ws-number-prior-years
move 0 to spacer-count
move spaces to prt-detail-line
perform print-rpt-detail-line.
perform accum-grand-totals.
perform rd-slscompwk-file-next.
if slscompwk-file-stat = 10
move "Y" to ws-slscompwk-EOF
end-if.
format-print-detail-record.
move slscompwk-trx-date to ws-date-3.
perform fmt-ws-date-3.
move dspl-date to prt-trx-date.
move slscompwk-day to prt-day.
move slscompwk-txbl-mdse to prt-txbl-mdse.
move slscompwk-disc-amt to prt-disc-amt.
compute prt-net-mdse =
slscompwk-txbl-mdse - slscompwk-disc-amt.
move slscompwk-tax-amt to prt-tax-amt.
move slscompwk-freight-amt to prt-freight-amt.
move slscompwk-total to prt-total.
move slscompwk-non-sls-amt to prt-non-sls-amt.
move slscompwk-no-of-trxs to prt-no-of-trxs.
move slscompwk-inv-trx-amt to prt-inv-trx-amt.
move slscompwk-no-of-inv-trxs to prt-no-of-inv-trxs.
add 1 to spacer-count.
0@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
<jeff@xxxxxxxxxx> wrote:
I have a program that I wrote that creates a work file to read from to
create a print record. The program is a sales report that allows the
user to specify how many years to compare. An example is 07-01-06 thru
07-31-06 If they answer 3 prior years it would show sales data (it also
handles exact day instead of just 070106, 071005, 070104)
20060701
20050702
20040703
20060702
20050703
20040704
When I read the Work file I need to read 2 recs before writing the
print record to calculate the percentage change in amount.
That's usually accomplished by coding two READ statements.
DD
.
- Follow-Ups:
- References:
- Prev by Date: Re: READING 2 RECS before write to PRINT REC
- Next by Date: Re: Conext Menus
- Previous by thread: Re: READING 2 RECS before write to PRINT REC
- Next by thread: Re: READING 2 RECS before write to PRINT REC
- Index(es):