× 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.



Buddy,
Generally to change WHICH printer your output goes to you'd control the
output queue of the job. The output queue is tied to a particular printer.

If you want your printer file to be internally formatted a certain way
(data-stream wise), like for *IPDS or something specific, yes you do that on
the printer file itself or, I believe, on a great big OVRPRTF command.

If you're still having trouble being allowed to view the printer output,
usually this is because the program still has the file open even though the
program has "ended". Try submitting the program to batch. If, after that,
you can see the printer output, you should make sure the program ends with
LR *ON if this program is to be used in an interactive environment, or
multiple times within one job otherwise the file will remain open. While
this is handy for having multiple programs write to the file during a job
stream, I think this is not the effect you're looking for.

Stu




On Fri, Jul 10, 2009 at 14:20, Buddy McClean <Buddy.McClean@xxxxxxxxxxxx>wrote:

By using OVRPRTF for an external print file, It put something in the spool
file that the writer didn't know
how to handle, so even when the program ended, all I could do was delete
the entry. I'm sure there
is technical reason for it. Just dangerous enough ...

I'm speculating that to change print device ID's, I would do a CHGPRTF from
the CL.

All the examples of overflow were just what I needed.


rowestu@xxxxxxxxx 7/10/2009 1:30:45 PM >>>
Hey Buddy,

By "writing something weird" do you mean some text (like "Daily ASN
Report")
and then a bunch of underlines? This is normally what the UNDERLINE keyword
does when you view the report online. If you print it you will see the
text, underlined. Normally these days I will wriote a line of underlines
(underscore characters), THEN the text that goes with it. This makes the
text appear online (but not the underlines). At least you get column head
text then.

The exception you get at overflow is because you did not define an
"overflow" indicator. On the F-spec for the printer file, use the OFLIND()
keyword with an indicator in the parens (I use *IN88 myself). Then, when
*IN88 comes on, that's overflow and you should write HEAD again, then clear
*IN88 (RPG will not do it for you).

read file;
dow not %eof(file);
if *IN88;
write HEAD;
clear *IN88;
endif;
print detail lines






You can't see or print your spooled file because the program still has the
file opened even though the program ended because I don't see where LR gets
set on. Of course, it's been a LONG TIME since I've used an input primary
file.




On Fri, Jul 10, 2009 at 12:54, Buddy McClean <Buddy.McClean@xxxxxxxxxxxx
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



--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-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.