It's blowing up because when you write line 66, RPG wants to turn the overflow indicator on, and you haven't coded an overflow indicator.

Add an overflow indicator to your F-spec. Then, just ignore it in the rest of the code. The indicator will be turned on, but your program can just ignore it and keep printing.

-SK


On 12/13/2012 2:14 PM, Steve Richter wrote:
The following code blows up when printing on the 66th line on the page.
Overflow is set to 66. How can I write printer code that prints on each
line of the page?

( I am printing CSV formatted data, then emailing the spooled file. If the
page does not have all 66 lines filled, I get gaps in the resulting
spreadsheet. )

A R DSHPR075R
A N51 SPACEB(1)
A 51 SKIPB(1)
A LINETXT 132A O 1

Fdshpr075 O e PRINTER USROPN
f Infds( PrInfo )

D PrInfo DS qualified
D OfLinn 188 189b 0
D CurLinn 367 368b 0
D CurPagn 369 372b 0

** ---------------------- dshtest ----------------------------
ddshtest pr extpgm('DSHTEST')

** ---------------------- dshtest ----------------------------
ddshtest pi

** --------------------------- qcmdexc ------------------------
dqcmdexc pr extpgm('QCMDEXC')
d cmds 999a const
d cmdsLx 15p 5 const

d ix s 10i 0
d curLinn s 10i 0
d ofLinn s 10i 0
/free
qcmdexc( 'OVRPRTF FILE(DSHPR075) PAGESIZE(66) OVRFLW(66)':
80 ) ;
open dshpr075 ;
for ix = 1 to 66 ;
if ix = 1 ;
*in51 = '1' ;
else ;
*in51 = '0' ;
endif ;
lineTxt = 'line nbr ' + %char(ix) ;
write dshpr075r ;
curLinn = prinfo.curlinn ;
ofLinn = prinfo.oflinn ;
endfor ;

close dshpr075 ;
/end-free

C EVAL *INLR = *ON





Return to Archive home page | Return to MIDRANGE.COM home page