ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

usropn qsysprt

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

  • usropn qsysprt

    Hi All:

    Can anyone tell me whats wrong with this code?

    Code:
     FQSYSPRT   O    F  132        PRINTER USROPN
     C                   IF        NOT %OPEN(QSYSPRT)
     C                   OPEN      QSYSPRT           
     C                   END  
     C     *ENTRY        PLIST                                              
     C                   PARM                    PGMNAM                     
     C     PGMNAM        IFEQ      'SETONLR'                                
     C                   CLOSE     QSYSPRT                                  
     C                   SETON                                            LR
     C                   GOTO      ENDALL                                   
     C                   END                                                
        C     ENDALL        TAG                        
     *                                             
     OQSYSPRT   E            CHECKLDA          1    
     O                       PGMNAM              10

    I am expecting qsysprt to be opened once and remain open regardless of how many times the program is called. After the parm "SETONLR" is received I would expect qsysprt to close. What's actually happening qsysprt is opened and closed every time the program is called.


    Thanks
    GLS
    The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

  • #2
    Re: usropn qsysprt

    I would change the seton *LR to return.

    you may also want to do this
    OVRPRTF FILE(PRINTFILE) TOFILE(SOMELIB/PRINTFILE) SHARE(*YES)

    PHP Code:
    ~
          *===================================================

          * 
    PROGRAM -
          * 
    PURPOSE -
          * 
    WRITTEN -
          * 
    AUTHOR  -
          *
          * 
    PROGRAM DESCRIPTION
          
    *
          *
          *
          * 
    INPUT PARAMETERS
          
    *   Description        Type  Size    How Used
          
    *   -----------        ----  ----    --------
          *   
    InMode             Char  01      if passed 'E' then end
          
    *   Instring           Char  50      print this string
          
    *
          * 
    INDICATOR USAGE
          
    *
          *===================================================
         
    FQSYSPRT   O    F  132        PRINTER OFLIND(*INOF)
          *
          * 
    Program Info
          
    *
         
    d                SDS
         d  
    @PGM                   1     10
         d  
    @PARMS                37     39  0
         d  
    @JOB                 244    253
         d  
    @USER                254    263
         d  
    @JOB#                264    269  0
          
    *
          *  
    Field Definitions.
          *
         
    d InMode          s             01
         d Instring        s             30
         d PrintHead       s             01
          
    *
         
    c     *entry        plist
         c                   parm                    InMode
         c                   parm                    InString
          
    *
         
    c                   if        inmode 'E'
         
    c                   eval      *inlr = *on
         c                   
    else
          *
         
    c                   if        *inof or printhead = *blanks
         c                   except    head
         c                   
    eval      printhead 'Y'
         
    c                   eval      *inof = *off
         c                   
    endif
          *
          *
         
    c                   except    detail
          
    *
         
    c                   return
         
    c                   endif
          *==============================================

         
    OQSYSPRT   E            HEAD           1 03
         O                                           32 
    'something'

         
    O          E            DETAIL         1
         O                       instring            40


    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: usropn qsysprt

      Thanks Jamie

      I think that's gonna do the trick

      You wouldn't beleive how long i've been staring at that code

      GLS
      The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

      Comment


      • #4
        Re: usropn qsysprt

        I wont tell a soul...just you me and the 2 or three people who hit the site a day


        jamie
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment

        Working...
        X