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



Apparently what is not being seen is the message identifier which describes the failure. The expression /falls over/ is... well, let's just say /meaningless/.

As others suggest SPLFNBR(*LAST) is presumably what was desired. However IIRC there is an API that gets the /last spooled file/ information. Using the API is actually required to avoid a defect with the *LAST, whereby a /wrapped/ value might break the the assumption for meaning of *LAST. That issue is more prevalent in server jobs where the SPLFOWNER() becomes the *N/UserName/QPRTJOB.

Albert suggested OVRPRTF before the spooling, but did not clarify that the SPLFNAME() parameter could be used to assign a unique name so that successive copies would not have the same name as the previous. Perhaps that was because that advise was meant instead to allude to using OVRPRTF SAVE(*YES) before spooling as Stephen suggested, thus eliminating the need to even issue the CHGSPLFA after the spooling.

Realistically the *only* valid option is to just open the spool file with the SAVE(*YES). That is done by the OVRPRTF or CHGPRTF [or if\where available, to use open options\features which allow asking for SAVE(*YES) within a program opening the printer file to do the spooling; but then without SECURE(*YES) a prior override still does not guaranteed SAVE(*YES) would occur]. Why would I suggest the *only* valid option? Well... if the writer is active, then if the spooled file finishes writing before an after-the-fact CHGSPLFA runs, the spooled file is gone. Obviously other factors can be in play, for example HOLD(*YES) eclipses that difficulty. And if no writer is active but there is an active device, then a SPOOL(*NO) has the data print [¿effectively? without] a spooled file.

Regards, Chuck

Booth Martin wrote:
This is stumping me.

I want a report to print when the program is run, but I want to automatically save the spoolfile, too?

CHGSPLFA FILE(Filename) SAVE(*YES) works, but only if there is
only one > file. In other words, it works once, the second time
it falls over because there are two like-named spool files.
What am I not seeing?


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.