Change order of pages printed when more than 1 copy requested

20 pts.
AS/400 printing
I have a splf on the 400 that always has multiple pages but the # of pages varies. It might be page 1,2,3,4,5 today and only 1,2,3 tomorrow. I would like to print 2 copies but I NEED to print them in this order. Page: 1,1 then 2,2 then 3,3. This will apply to all the splf that print in that outq and/ or printer but to many diff rpg pgms. These reports willalso be distributed to many different printers. I would prefer not to change the rpg programs or the settings on every network printer but instead change a setting. I think there is a setting on either the printer file, the splf , the outq or the wtr defn that will allow me to do this. Does anybody know?

Answer Wiki

Thanks. We'll let you know when a new response is added.


I’ve had similar requests before and needed to change the programs to get the pages printed in the right sequences.

As far as I know, there’s no setting anywhere on the AS400 to allow this.

Maybe there’s something AFP, but that’s something I’ve never used.

Sorry to disappoint you.


Martin Gilbert.
Hi Vjeter
Phil here
This would be lame but you can put all the spool files on hold and save and then
print page 1 to 1 twice, page 2 to 2 twice, etc.
CL would
Get the list – wrkoutq to *print – copy to a datafile
read each row – substring for the data you need — TATOOL should have something for these steps?
set &page to 1
1. change the print-from and print-to &page
2. release the file wait
— wait until splf status in Save RTVSPLFA2 TAATOOL Retrieve Spooled File Attr 2 – RTVSPLFA2
3. release the file again
— wait until splf status is Save
4. change &page to &Page +1
loop until you reach the number of pages in the file + 1
proceed to the next spool file.
Second option would be a little like the first, probably prints faster
– copy each spool file to temp datafile with *FCFC
then read with RPG and write each page twice (one of the *FCFC values indicates new page into wrkfile 2
then copy wrkFile 2 to a spool file and release or move the the active outq. Will not work for AFPDS.
Third option would be to alter each program so it writes each page twice. That would be miserable.
Curious: why would anyone want it in this order? This was a PC invention to speed up printing.
Given the options that you’ve got it will slow down printing and cost $!


Discuss This Question: 3  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Vjeter
    did your program changes entail changing the rpgle logic to print page1 then page1 again or was it a different type of change?
    20 pointsBadges:
  • Yorkshireman
    As you say that all prints that Q need this treatment I would put a monitor on the Q, and within the monitor function use cpysplf to extract the print, a simple RPGLE function can then read the cpysplf and inject the duplicates. place this back into the Q, and remove the original (or archive it.) Read about monitored outq's and processing the associated data Q inthe manuals - there's plenty of information there. There are a number of products on the market which would do this - catapult or interform come to mind, but essentially all they do is use the monitored Q facility and work as above. As (Phil?) said - why would anyone want to do this? If it's to enable distribution, then make a second copy. Or use 2 part and a sprocket feed printer. I believe the mantra - 'We can do anything in IT' but sometimes the 'anything' needs to be questioning the perceived reality.
    6,085 pointsBadges:
  • Gilly400
    Hi, Yes, changing the RPG logic was the answer - to re-print each page multiple times before moving to the following page. Not a nice way to do it and it slowed the job down considerably, but it worked. Regards, Martin Gilbert.
    23,730 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: