ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Problem with trigger program

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

  • Problem with trigger program

    Hi guys, I have a trigger on a PF, but when it fires the trigger program has to call another program to do the rest of the job. When it comes to calling this program I get the following error message:
    PHP Code:
    Cannot resolve to object FILLDTQType and Subtype X'0201' Authority     
      X
    '0000'.                                                               
    Function 
    checkMCH3401 unmonitored by TRIGTEST at statement 0000000123
      
    instruction X'0000'.                                                   
    Error occurred while calling program or procedure *LIBL/FILLDTQ (C G D F
    As you can see, the trigger program is called TRIGTEST and the program it has to call is FILLDTQ.

    The thing is.. when I test it in my own library it works fine, but now it has to connect to a webpage through a DLL (the DLL writes to the PF and fires the trigger which calls TRIGTEST.

    Does anyone know why this is happening? I suspected an authority thing, so I gave the user that is handling the part of the firing of the trigger (QUSER) authority on the files it needs, but in vain. Any help would be much appreciated!

  • #2
    Re: Problem with trigger program

    mlcoolj,

    It looks to me as if the object FILLDTQ is not found. Double check the library list and check where the object FILLDTQ resides.

    HTH,
    MdnghtPgmr
    "Tis better to be thought a fool then to open one's mouth and remove all doubt." - Benjamin Franklin

    Comment


    • #3
      Re: Problem with trigger program

      yeah, it resides in my worklibrary, how can I change the library list of QUSER so I can add my library to it?

      Comment


      • #4
        Re: Problem with trigger program

        Im not sure I would change the user QUSER.
        this will change all jobs that "start" using the QUSER profile
        to run with your test library..
        if your test library is like mine then that would be very bad!

        but that said....look at the profile and see what jobd is being
        used then add the library there... Now if other profiles
        use this jobd then they also get your test library.


        maybe you could mod trigger to use qcmdexc and add your library while testing


        jamie




        just add your library prior to running test.

        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


        • #5
          Re: Problem with trigger program

          ok.. thanks for the replies, I thought of adding the library IN the trigger program before I call FILLDTQ.

          Comment


          • #6
            Re: Problem with trigger program

            ok, I fixed the problem, I had to add my library list as well as give permissions to run my programs.

            Thanks for your help guys!

            Comment


            • #7
              Re: Problem with trigger program

              OK guys, before this explodes in my face... I was thinking. If I try to add the library to the library list, and it's already there, then I will surely get a message! How can I catch this message in RPGLE? Here's a bit of my code where I add the library:
              PHP Code:
              C                   EVAL      WCMD 'ADDLIBLE MYLIB' +
              C                                    ' POSITION(*FIRST)'
              C                                                       
              C                   
              EVAL      WLEN= %LEN(%TRIM(WCMD))   
              C                   CALL      'QCMDEXC'                 
              C                   PARM                    WCMD        
              C                   PARM                    WLEN 
              Is there a monmsg-like command that I can use here?

              Comment


              • #8
                Re: Problem with trigger program

                OK after a little bit of looking around I found it, so my code looks like this now:
                PHP Code:
                C                   MONITOR                              
                C                   
                EVAL      WCMD 'ADDLIBLE MYLIB' 
                C                                    ' POSITION(*FIRST)' 
                C                                                        
                C                   
                EVAL      WLEN= %LEN(%TRIM(WCMD))    
                C                   CALL      'QCMDEXC'                  
                C                   PARM                    WCMD         
                C                   PARM                    WLEN         
                C                   ON
                -ERROR  *PROGRAM                   
                C                   ENDMON 
                As you can see, I used the MONITOR command to fix this.

                Comment

                Working...
                X