ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

OVRPRTF in COBOL

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

  • OVRPRTF in COBOL

    I have a COBOL program that sends the output to an out queue to be picked up by another (external to IBM i) program for formatting and printing. Well, now, there is a need to send the data for one particular customer to a second out queue instead of out queue "A".

    Coming in to the program, the CL that calls it does OVRPRTF on multiple options (number of copies for example). The only thing I have to change is the out queue: if it is customer "B" change the out queue to "B" otherwise, continue to use "A".

    In short, it doesn't work. I've looked online and through programs on our system, and haven't had any luck. I've moved the "CLOSE" statement to before the "IF" statement, but that didn't help. Is it because the printer is "QPRINT"? Does that matter? Any hints will be greatly appreciated. Thank you.

    PHP Code:
               SELECT PRINTER-FILE                
                 ASSIGN       TO PRINTER
    -QPRINT   
                FILE STATUS IS PRT
    -STATUS.       

    **********  
    ER0016588   START OF CHANGE*******************          
          
    01  WS-QCMDEXC-FIELDS.                                             
              
    05  CL-CMD-LE0000                   PIC X(38)                  
                           
    VALUE 'OVRPRTF FILE(QPRINT) OUTQ(B)'.    
              
    05  CL-CMD-OTHER                    PIC X(38)                  
                           
    VALUE 'OVRPRTF  FILE(QPRINT) OUTQ(A)'.    
              
    05  CL-CMD_LENGTH                   PIC 9(10)V9(5COMP-3      
                                                  VALUE 38.                  
              05  CL
    -FIRST-TIME                   PIC X(01).                 
         **********  
    ER0016588    END OF CHANGE *******************      



              
    4400-PRINTER-OVERRIDE.                                       

               IF   
    OHR-CUST-ACCT =  'LE0000'                           
                  
    CALL 'QCMDEXC' USING CL-CMD-LE0000  CL-CMD_LENGTH     
               
    ELSE                                                     
                  
    CALL 'QCMDEXC' USING CL-CMD-OTHER   CL-CMD_LENGTH.    

                 
    CLOSE PRINTER-FILE.                              

                 
    OPEN OUTPUT PRINTER-FILE

  • #2
    In RPG, I always specify OVRSCOPE(*JOB) parameter on the OVRPRTF command when I do this.

    Comment


    • #3
      Originally posted by jtaylor___ View Post
      In RPG, I always specify OVRSCOPE(*JOB) parameter on the OVRPRTF command when I do this.
      Thank you - I had JUST figured out it had something to do with OVRSCOPE. I was going to follow-up asking for advice on which one to use because I really don't understand it. I have a document to read so hopefully I'll get it straight in my head.

      Comment


      • #4
        Happy dance! That was the kick in the head I needed. Thank you, jtaylor.

        Comment


        • jtaylor___
          jtaylor___ commented
          Editing a comment
          You're welcome. With QCMDEXC, I always use OVRSCOPE(*JOB).
      Working...
      X