ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Printing from Bottom to Top

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

  • Printing from Bottom to Top

    Hi,

    I need to print existing SCS and IPDS-Spoolfiles from bottom to top.

    Has someone an idea how to realize this?

    Birgitta

  • #2
    Re: Printing from Bottom to Top

    Hi Birgitta,

    it might be a long way, but you could try using the the following:
    Use the QSPGETSP api to get the data (you will know where to start by the no. of pages in your spoolfile-fmt100). Then use the QPPUTSP api to write it out page by page to another spoolfile. Voila! she is then in reverse order.
    Last edited by kitvb1; May 26, 2008, 07:51 AM.
    Regards

    Kit
    http://www.ecofitonline.com
    DeskfIT - ChangefIT - XrefIT
    ___________________________________
    There are only 3 kinds of people -
    Those that can count and those that can't.

    Comment


    • #3
      Re: Printing from Bottom to Top

      you could use this as your basis pgm http://www.code400.com/cpyfrmsplf.php

      Also, you will need to change the following if working on v540
      Code:
      JM   c                   If        VerRelMod >  510    
      c002 c                   eval      reclen = 3841       
      JM   c                   endif
      Regards

      Kit
      http://www.ecofitonline.com
      DeskfIT - ChangefIT - XrefIT
      ___________________________________
      There are only 3 kinds of people -
      Those that can count and those that can't.

      Comment


      • #4
        Re: Printing from Bottom to Top

        Hi,

        the problem is not printing from the last page to the first page, but beginning with the last line to the first line. Theoretically turning the spoolfile around 180 degrees and then printing.

        Birgitta

        Comment


        • #5
          Re: Printing from Bottom to Top

          Could it not be sent to the printer to rotate 180 degrees?
          Bill
          "A good friend will bail you out of jail,
          A true friend would be sitting beside you saying,
          'Wow, that was fun.'"

          Comment


          • #6
            Re: Printing from Bottom to Top

            Ok, now I know what you want - thought you wanted in reverse order for binding after printing.

            Change the order by to make it descending if using SQL. Use a LF with a descending key as opposed to ascending if using reade or lowkey logic. Other than that, there shouldn't be much else to change in the program, maybe the break level checks.

            You could also use a really bad way and use readp all the way trhough using the existing LF instead of creating an index
            Last edited by kitvb1; May 26, 2008, 10:14 PM.
            Regards

            Kit
            http://www.ecofitonline.com
            DeskfIT - ChangefIT - XrefIT
            ___________________________________
            There are only 3 kinds of people -
            Those that can count and those that can't.

            Comment


            • #7
              Re: Printing from Bottom to Top

              Hi Kit,

              it's not me who creates the spoolfile, the spoolfiles are already created.

              Even if I'd use CPYF into a physical file and copy the rows in reverse order back to the spoolfile, the result will not be the same than turning the complete spoolfile 180 degrees.

              What I'd need is a complete mirroring of an existing spoolfile.

              Birgitta

              Comment


              • #8
                Re: Printing from Bottom to Top

                Originally posted by B.Hauser View Post
                Hi Kit,

                it's not me who creates the spoolfile, the spoolfiles are already created.

                Even if I'd use CPYF into a physical file and copy the rows in reverse order back to the spoolfile, the result will not be the same than turning the complete spoolfile 180 degrees.

                What I'd need is a complete mirroring of an existing spoolfile.

                Birgitta
                Try loading the paper into the printer backwards ?
                Or print it out and then turn it 180 degrees before handing it to the clown who want's it backwards !
                Greg Craill: "Life's hard - Get a helmet !!"

                Comment


                • #9
                  Re: Printing from Bottom to Top

                  Hi Birgitta

                  I was talking about changing the program that creates the spoolfile. If it's a simple report program, then it's a quick change - depending on complexity of the app and the level breaks therein.
                  Regards

                  Kit
                  http://www.ecofitonline.com
                  DeskfIT - ChangefIT - XrefIT
                  ___________________________________
                  There are only 3 kinds of people -
                  Those that can count and those that can't.

                  Comment


                  • #10
                    Re: Printing from Bottom to Top

                    Hi,

                    the problem is, it is/was a client's requirement. The spoolfiles are already created, that's why I have no chance to change the sequence when creating the spoolfile.

                    ... and my managers always think the clients are the kings and we programmers are only incompetent to realize the easiest requirements. That's the problems if your managers are only salesman and have no idea about programming.

                    ... my managers always think the clients are the kings and everything they want must be realized and we programmers are only incompetent to realize the easiest requirements. That's the problems if your managers are salesmans who have no idea about programming.

                    Birgitta

                    Comment


                    • #11
                      Re: Printing from Bottom to Top

                      a dumb idea...CPYSPLF into a flat file read it backwards page by page and write to a new spooled file.
                      I'm not anti-social, I just don't like people -Tommy Holden

                      Comment


                      • #12
                        Re: Printing from Bottom to Top

                        Hi Tom,

                        Even if I copy the spoolfile into a physical file and recreate a new one beginning with the last row, I cannot turn the letters. The result will be something like:

                        PHP Code:
                        Total   12345,66

                        200 ItemNo1    123
                        ,45
                        100 ItemNo2    444
                        ,22

                        Pos  Item       Price
                        Invoice No  12345 
                        Birgitta

                        Comment


                        • #13
                          Re: Printing from Bottom to Top

                          Birgitta,

                          Sounds like that your trying to create a "reverse image" of the report. ..similar to what would happen when viewed in a mirror.

                          Is this true? If so, then follow the original idea of using CPYSPLF and reading it backwards but as you read each line you'll need to process the line as an array of bytes from right to left. This will flip the letters in the line.

                          Terry

                          Comment


                          • #14
                            Re: Printing from Bottom to Top

                            not even if you OVRPRTF on the "new" print file you're creating? you should be able to rotate the print via the override.
                            I'm not anti-social, I just don't like people -Tommy Holden

                            Comment


                            • #15
                              Re: Printing from Bottom to Top

                              copy to pf
                              copy to .txt file
                              import to wordperfect, word etc. doc
                              and start imbedded macro
                              reverse the characters
                              make them upside down
                              turn them inside out
                              shake them all about

                              ...
                              and print
                              voila
                              Regards

                              Kit
                              http://www.ecofitonline.com
                              DeskfIT - ChangefIT - XrefIT
                              ___________________________________
                              There are only 3 kinds of people -
                              Those that can count and those that can't.

                              Comment

                              Working...
                              X