Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Multiple Spoolfiles merged into One Spoolfile

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple Spoolfiles merged into One Spoolfile

    I thought I had seen this question before but I could not find in the archives. I have a program that creates four separate spool files in a RPG program that I would like to consolidate into one large spoolfile (Take the completed first report, add the next report and so on). In my case the four reports are emailed as an attachment (each one is separate) that irritates my user that he must open four separate emails to review the data. My program creates the four reports as records are read from the database files and each one utilizes the data as it is read. Some changes are made to the data so I can not just read again after the first pass. Any help or reference point would be greatly appreciated. Randy K. Lessor Pizzagalli Construction Co. 802 651-1261

  • #2
    Multiple Spoolfiles merged into One Spoolfile

    This may not be the slickest way to do it, but I think it would work: 1) create a pf named TMPSPLF (or whatever) with a length that is 4 positions longer than your widest spool file 2) immediately after your rpg program runs, issue the following commands: CPYSPLF FILE(QSYSPRT1) TOFILE(TMPSPLF) SPLNBR(*LAST) CTLCHAR(*FCFC) CPYSPLF FILE(QSYSPRT2) TOFILE(TMPSPLF) SPLNBR(*LAST)MBROPT(*ADD) CTLCHAR(*FCFC) CPYSPLF FILE(QSYSPRT3) TOFILE(TMPSPLF) SPLNBR(*LAST) MBROPT(*ADD) CTLCHAR(*FCFC) CPYSPLF FILE(QSYSPRT4) TOFILE(TMPSPLF) SPLNBR(*LAST) MBROPT(*ADD) CTLCHAR(*FCFC) 3)issue this command: OVRPRTF FILE(QSYSPRT) CTLCHAR(*FCFC) 4) finally, issue this commad: CPYF FROMFILE(TMPSPLF) TOFILE(QSYSPRT) This should accomplish what you are asking. HTH, Joe

    Comment


    • #3
      Multiple Spoolfiles merged into One Spoolfile

      Randy, In addition, to Joe's good response, you have to make sure that attributes (CPI, LPI, page size, etc) of Spool Files match those in QSYSPRT. If not, OVRPRTF QSYSPRT CTLCHAR(*FCFC) with attributes (CPI, LPI, Page size, etc) your spool files had before copy to PF. Also, let you know, just in case, CPYSPLF can't save IPDS or AFP from Spool File into PF. Ira

      Comment


      • #4
        Multiple Spoolfiles merged into One Spoolfile

        PDFing will do what you want. Try www.bvstools.com for a start.... bobh

        Comment


        • #5
          Multiple Spoolfiles merged into One Spoolfile

          Seems like you could also use the PRINT API's to combine the multiple spool files into one large one.

          Comment


          • #6
            Multiple Spoolfiles merged into One Spoolfile

            Hello Randy, If you're interested in a commercial solution, take a look at our AS/400 Report Splitter software. The Report Splitter contains a RPTMRG command to allow you to easily consolidate multiple reports into a single spool file. Take a look at our web site or feel free to contact me directly. Regards, Richard Schoen RJS Software Systems Inc. "The AS/400 Report Distribution Experts" Email: richard@rjssoft.com Web Site: http://www.rjssoft.com

            Comment


            • #7
              Multiple Spoolfiles merged into One Spoolfile

              what you can do is: In a cl program Override the printfile to share(*yes). Open the print file. Have all 4 programs write to that print file. You have to generate the output one report at a time with this method, if pgm1 writes to the spool file, then pgm2, then pgm 1 again your spooled output will be just that. (in the order in which it is written). I have used this method to produce header information from one program and detail information from other programs to generate one report. It works well.

              Comment

              Working...
              X