Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I setup and write to multple QSYSPRTs in single old RPGIII pgm?

Status
Not open for further replies.

DucksUnlimited

Programmer
Jan 18, 2012
3
0
0
US
Need to change an old RPG III pgm to write 8 QSYSPRT in one program. Can't say I have ever seen it done. Can it and how?
 
Are you trying to create 8 copies or printing 8 different reports. Both ways are doable. For 8 copies you can override printer attribute in CL to have any number of copies. For reports you will need to output into different print devices and still override each device attributes in a CL.
 
Thank you so much for your response. Using this old program I need to create 8 similar sets of invoices rather than the one set it now creates. And they need to be created in the program using the layout setup within the program itself. Not as files or printer files. As long as I have been doing this (20 plus years) I have never seen more than one IBM QSYSPRT within a program (you know the kind..with report output specs located at the bottom of the program). I think I will just set up a call to it 8 times passing in the vendor for each set of invoices. Have you ever seen more than one QSYSRPT? I could be wrong.
 
Could not understand what you tried to accomplished. There are so many ways you can skin a cat(pardon me). If you are trying to print 8 copies of the same invoice but with different vendor, then why not put the printing routine as a subroutine. This way you can call the subroutine x number of times. Like you, I started RPG using S/3 to AS400 and other machines like Burroughs. The last time I programmed in RPG-IV was 1990.
 
This is legacy code and I need the individual QSYSPRTs as each will become a PDFs then attached to email and sent out all by my CLLE each day unassisted so their need to be separate is required. I do not want to do a rewrite, no time. There really are better ways to do this than REP III. Thank you for your time and interest. With the speed of machines calling it 8 times and passing the Vendor and the email addresses will be fast, just not very pretty.
 
Well,, you can code 8 different printers. you have the qsysprt01, qsysprt02, etc, etc. Have them all controlled the same, and you get 8 different printer files, on the outq. You may get 8 different outqs, not really sure. And you may have to add CL, to get everything organized correctly. There is a piece of software called Gumbo, that will automatically convert any output to pdf, and send them to the appropiate email address. We used Gumbo for years, with JD Edwards World, and had reports emailed as pdfs everywhere. Very handy thing to have around. If you are running this in an S36 Environment, I am not sure how many printers are supported.
 
As a programmer I'm always challenged to know what the best method out there. It would be a disservice if I cannot at least give a try to prove that I can do it. Sure time for me is never an excuse. I used to labor night and days just to understand what's out there. When certain challenges comes then I can at least sufficiently say maybe there is a way. Here's a challenge that I used to undertake with much success: In AS400 you are asked to create programs that will print W2s, pay checks, invoices etc. All these requirements need to print in high graphics that includes signatures, logos boxes, micr etc. Certainly Any modern RPG or COBOL program cannot do it. I did all of them by installing an new object oriented language called SQR (this was new back then). This product can be installed in any platform and I'm still using it. The output itself can be converted to many format like pdf and very simple to use if you know SQL scripting. This product can also open different database types all at the same time like db2 or oracle or sybase.
 
DucksUnlimited,

I have never seen more than one QSYSPRT at a time in a program. It is not possible to have two printer files with the same name in the same program.

Your approach to calling the program 8 times with the appropriate overrides is likely the way I would have approached the problem.

I keep trying to do something about my procrastination but I keep putting it off until tomorrow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top