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



Dave Boettcher wrote:

Has anyone ever seen a printer file designated as a
disk file in a RPGLE program?

The F spec looks like this:

ferrctrec o e disk

I spent some time searching for the file be fore I
discovered that it was a printer file.

And it still amazes me that it is used as a print file
and labeled disk in the f spec.

Anyone else seen this?

Just curiosity at this point.

Some programs intend to be able to produce a /report/ which is nothing more than a /flat file/, where the output device is left as a choice of the user\caller. IMO declaring a printer file with an allowance for disk file is better than vice versa.

Probably not a good coding practice to just identify a file name as any one type, other than what is actually intended to be used in the program. However, the /common data management/ enables opening files of various types, and there are worthwhile reasons in being able to do so. FWiW the same could have been accomplished at runtime instead, using OVRPRTF or OVRDBF [for example], even if the file declaration in the program source matched the object file type. Note that it is probably best to use output-only if the program intends that a printer file might be used instead of a database file. The /open feedback/ can be referenced by the program to determine which type of file was actually opened for use at run-time. So a program intending to use either disk or spool can declare the DISK file only, yet produce whichever /report/ based on the file type which was opened, even coding some specific reaction to which file type was opened. To get the full benefit of a printer file however, having two USROPN files declared and a procedure specific to each, may be worthwhile, depending on the goal\intent of the program.

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.