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



Your generate command sounds like the problem.

ovrprtf works very well in OCL statements.

The ocl will report the printer name as whatever is in the
the rpg program. REPORT was a VERY common
name used in billions of RPGII programs.

You should be overriding the file name(REPORT) to
QPRINT or Qsysprt or whatever you need it to be.

An example:

// LOAD #GSORT // FILE NAME-INPUT,LABEL-?1'LOSSRATE'?,DISP-SHR // FILE NAME-OUTPUT,LABEL-?WS?LOSS,RECORDS-1000,RETAIN-J,EXTEND-100
// RUN HSORTR 23A 3X 128 N N I C 1 3EQCLTC IAC 11 12EQC04 FNC 78 80 FNC 1 15 FDC 1 128 // END OVRPRTF FILE(REPORT) TOFILE(QSYSPRT)
I'm not clear on exactly what your problem is ?

Jerry Adams wrote:
I have a boatload of legacy RPG II programs that run via OCL in the 36 environment. I've used OVRPRTF commands in OCL before, but always for things like Query/400 reports.

I've written a generate command and processing program that build the appropriate OVRPRTF command. So far, though I've only used this in CL's. I would like to use it in OCL, too, because, among other things, it can automatically use a substitute printer, rather than the normal one, when the printer has, well, gone south temporarily.

Anyway, while my command and program build and execute the OVRPRTF command successfully, the OCL sends the report to printer defined in the QPRTDEV system value; i.e., it is ignoring the print device in the generated OVRPRTF command.

I am pretty sure that the reason for this problem is that I cannot get the TOFILE( ) parameter right. I tried QSYSPRT, but that did not help. The name of the program-described printer is REPORT, but I can't use that. Does anyone know (or even be willing to hazard am educated guess) what TOFILE( ) value would work for a program-described RPG II printer file?

Thanks.

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


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.