× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



While the OVRPRTF was incorrect, I often (nearly always) use an OVRPRTF in either a CL or a procedure in the program (the print file must be defined as USROPN and the procedure invoked before the file is opened). Why? If for no other reason than to direct the report to a different printer on each invocation based upon some criteria or user selection, to use the EXPDATE option, etc.

If the CL had simply been: OVRPRTF FILE(TST117PRT) TOFILE(TST117PRT) DEV(P2), then there would have been no adverse impact. QSYSPRT can be used for program-described printer files.

Jerry C. Adams
IBM System i Programmer/Analyst
--
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Buddy McClean
Sent: Friday, July 10, 2009 1:55 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Ext Print Files - In the Beginning

By the way, why are you overriding your printer file in the CL? That
could be a whole bunch of your troubles. Try just calling TST117
without using the CL. That might surprise you.

That was it and it did.

booth@xxxxxxxxxxxx 7/10/2009 1:38:45 PM >>>
FTST117PRT O E PRINTER oflind(*in36)

* Is Overflow on?
C if *in36 = *on
C write footer
C write HEAD
C eval *in36 = *off
C endif
* Print detail
C.... etc
C write DETAIL

C *inzsr begsr
C write HEAD
C endsr

Something like that should work for you.

By the way, why are you overriding your printer file in the CL? That
could be a whole bunch of your troubles. Try just calling TST117
without using the CL. That might surprise you.



Buddy McClean wrote:
Good Day,

I am just starting on Externally described print files and my first attempt is not very satisfying.

The code below prints generic heading and then detail lines (if any).

The 'Write HEAD' executes but apparently is writing something weird. If I 'Write Head' enough times to trigger overflow, I get a
halt that tells me I did, but I suppose failed to handle it properly. So it writes something.

If I have detail - the detail prints fine and when I look at the spool entry - no output visible by 'write head'.

If I have no detail ( but 'write head' executes ) - the spool file exists but it won't let me browse, print, or copy the entry. I assume it put out
something - trash maybe.

In Addition, If anyone could point me to a good explanation of handling overflow, that would be nice.

Thanks



H DftActGrp(*No) ActGrp(*Caller)
H*Debug(*No) Optimize(*Basic)
H Debug Optimize(*None)
H InDent('>') Text(*SrcMbrTxt)
H Option(*NoXref :*NoShowCpy : *NoExpDDS : *Ext : *Showskp :
H *NoDebugIO)
0004 FPOMASTER IPE E K Disk
0003 FPOASN IF E K DISK
0005 FTST117PRT O E PRINTER

0019 D RecDate S D INZ(*SYS)
0019 D TodayDate S D Inz(*SYS)

D ASNPo S Like(PAPon)
D ASNItem S Like(PAItem)
D EOFASN S N

* below in lieu of ext desc print file
D*ponum S 5 0
D*item S 5 0
D*line S 3
D*part S 30
D*qtyleft S 5 0
D*ORDN S 10
D*ASNDAT S L Datfmt(*MDY)
D*firm S 15
D*asnqty S 5 0
D once S N



IPORec1 01

/FREE

// Eval once = *On;
if not Once;
Eval once = *On;
write HEAD;
endIf;

If *IN01 and
PODEL = ' ' and
POLnk = 0 and
PORDat > 0;
//
// CONVERT Rec Date
//
Eval RecDate = %Date(PORDat:*CMDY);
//
// Find Matching date and print po heading
//
If RecDate = TodayDate and
(POQty - POQtr) > 0;

Eval Ponum = POPon;
Eval Item = POItm;
Eval Line = POLin1;
Eval Part = POPrt1;
Eval QtyLeft = POQty - POQtr;

Write PODetail;
//
// Read POASN to find matching entry
//
Eval ASNPO = PoPon;
Eval ASNItem = PoItm;

Setll(E)KeyASN POASN;

Eval EOFASN = *Off;
Dow Not EOFASN;

Read POASN;

If %Error or %EOF;
Eval EOFASN = *On;
Iter;
EndIf;

If PAPon <> PoPon or
PAItem <> PoItm;
Eval EOFASN = *On;
Iter;
EndIf;
//
// Print ASNDetail for Matching PO/Item
//
Eval OrdN = PAOrdN;
Eval AsnDat = PADate;
Eval Firm = PAFirm ;
Eval ASNQty = PAQty;

Write ASNDetail;

EndDo;

EndIf;

EndIf;

/End-free
CSR *INZSR Begsr

C KeyASN KList
C KFLD ASNPo
C KFLD ASNItem

C EndSr

PRTF

A*%%TS DD 20090709 162645 buddy REL-V5.0.1 WDSc
A*%%PR 2066132I
A*%%EC
A* CRTPRTF FILE(MARR/OPN117PRT) SRCFILE(MARR/QRPGLESRC) SRCMBR(OPN117PRT) D
A* OPTION(*EVENTF) PAGESIZE(66 80 *ROWCOL) REPLACE(*YES)
A*
A R HEAD SKIPB(02) SKIPA(05)
A*%%TS DD 20090630 110016 buddy REL-V5.0.1 WDSc
A*%%RI 00000
A 4' OPN117'
A 43'Daily ASN Report'
A* 70DATE
A* EDTCDE(Y)
A* SPACEA(1)


A* 4'P.O. Number'
A* UNDERLINE
A* 17'Item'
A* UNDERLINE
A* 25'Line'
A* UNDERLINE
A* 35'Part Number'
A* UNDERLINE
A* 66'Qty Remaining'
A* UNDERLINE
A R PODETAIL
A*%%TS DD 20090630 110016 buddy REL-V5.0.1 WDSc
A*%%RI 00000
A PONUM 5 0O 5EDTCDE(3)
A ITEM 5 0O 17EDTCDE(3)
A LINE 3 O 26
A PART 30 O 32
A QTYLEFT 5 0O 70EDTCDE(3)
A SPACEA(1)
A R ASNDETAIL
A*%%TS DD 20090709 162645 buddy REL-V5.0.1 WDSc
A*%%RI 00000
A 5'Order# -'
A ORDN 10 O 14
A 26'Date -'
A ASNDAT L O 33TEXT('ASN Date')
A DATFMT(*MDY)
A 44'Firm -'
A FIRM 15 O 51
A 67'Qty -'
A ASNQTY 5 0O 73EDTCDE(3)
A SPACEA(2)

CL

OVRPRTF FILE(TST117PRT) TOFILE(QPRINT) DEV(P2)

CALL TST117

DLTOVR FILE(*ALL)

ENDPGM

Buddy McClean
IT Director
Ext 106
Marr Bros Inc
214.948.7387
1.800.627.7276
Ext 106



------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.387 / Virus Database: 270.13.9/2228 - Release Date: 07/09/09 18:07:00



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.