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



Hi Terry -

What is described for share(*yes) is exactly what I want to do.
But possibly there is more to it than 1st glance.

It will not seem to work for me.

OVRPRTF    FILE(QSYSPRT) DEV(PRT05) PAGESIZE(*N &PGE) +
             CPI(&CPI) SHARE(*YES)

.... &pge and &cpi are defined elsewhere in the cl.
...... these are used to manipulate the output for pdf or ascii printer.

There are two programs run sequentially in line in the same cl.
The printer statements are exactly the same.

I get two full reports instead of being combined.

As has already been mentioned, the file itself actually has to stay open.


To avoid changing the programs that actually generate the reports, I recommend writing a simple program that you call twice; once before the first report program, and again after the second report program.

This program has the same printer file, with dummy output that will never actually be written.

The program has a named indicator that is initially off:

d @secondtime s n inz(*off)

The main program code is:

  c                    if     @secondtime
  c                    eval   *inlr = *on
  c                    else
  c                    eval   @secondtime = *on
  c                    endif
  c                    return

On the first call, the printer file will be opened automatically (don't make it USROPN). @secondtime will be turned on. The program will return with LR off, leaving the printer file open.

The two report programs will share that open data path, thereby putting both reports into one spooled file.

On the second call, LR will be turned on. The program will return with LR on, so the printer file will be closed automatically, which will close the spooled entry.

Ken
http://www.ke9nr.net/
Opinions expressed are my own and do not necessarily represent the views of my employer or anyone in their right mind.



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.