Scott's right. I'd forgotten that part. If you don't define an overflow indicator, RPG will try to do overflow processing for you.

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Thursday, December 13, 2012 2:20 PM
To: Midrange Systems Technical Discussion
Subject: Re: how to print on every line of the page, from 1 to 66?

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

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.