Announcement

Collapse
No announcement yet.

printing only certain pages of a afpds spool file

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

  • printing only certain pages of a afpds spool file

    I have a project where I need to be able to look at the contents of a spool file, find a certain value and if it exists only print that page.

    Little more background, we have canned piece of software that prints out these order summary pages in an afpds spool file. I need to hold the spool file and when an employee is ready to process that order go find that order in the spool files of which there could be many and just print that particular page for that order.

    Tried coping to PF but afpds does not work with that. I know there is some software out there that could help but hoping not to have to buy anything quite yet.

  • #2
    Re: printing only certain pages of a afpds spool file

    how do you know when an employee is ready to process?

    Could you not see this event and do a "Reprint" instead of all the fuss.
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment


    • #3
      Re: printing only certain pages of a afpds spool file

      The only reprint they have basically voids the first order and creates a new one, so that the original order does not make it out of the building by mistake. I have been trying to go at that angle but so far have not come up with anything.

      Comment


      • #4
        Re: printing only certain pages of a afpds spool file

        Hmmm... well, this is probably not a simple answer, but... You could use the Host Print Transform API with a *WSCST to convert the spooled file into a simple text file. Interpret that file (keeping track of the pages as you read through it) and find the string you're looking for. Then, do CHGSPLFA to set the appropriate page to print, and release the spooled file (with SAVE(*YES) probably so you can do it again if need be.)

        Sounds simple, but the Host Print Transform API is extremely complicated to use.

        To avoid that API, you might be able to use the CPYSPLF CL command, which at v7r1 does support the ability to write to an IFS stream file. You could use that do do the host print transform instead. There's also the 'catsplf' QShell command -- but if CPYSPLF doesn't work, 'catsplf' probably won't either.

        Comment


        • #5
          Re: printing only certain pages of a afpds spool file

          I would contact the vendor and see if they have a reprint api , not the one you know but one that is hidden in some call.
          Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

          Comment


          • #6
            Re: printing only certain pages of a afpds spool file

            Looking at copying to a stream file, I will also have to a *WSCST to turn it into a text file.

            Also trying to get some help from the vendor.

            Thanks.

            Comment


            • #7
              Re: printing only certain pages of a afpds spool file

              If it helps, here's an example of a very simple *WSCST that should convert a spooled file into a plain text file:

              Code:
              :WSCST DEVCLASS=TRANSFORM.  
                                          
                  :TRNSFRMTBL.            
                  :INITPRT                
                    DATA =''X.            
                  :SPACE                  
                    DATA ='20'X.          
                  :CARRTN                 
                    DATA =''X.            
                  :FORMFEED               
                    DATA ='0D0A0C'X.      
                  :LINEFEED               
                    DATA ='0D0A'X.        
              :EWSCST.
              You would typically put that into a member in a source file named QTXTSRC and compile it with the CRTWSCST command. Once that has been done, you can reference it as a WSCST on commands line CPYSPLF or the host print transform functionality.

              Comment

              Working...
              X