Trigger help please - IBM AS400

This is a discussion on Trigger help please - IBM AS400 ; Hi all I have a problem with some trgiggers not firing. FILEA in LIBRARYA with TRIGGER1/2 enabled works beautifully. FILEA in LIBRARYB with TRIGGER1/2 enabled does not even fire the trigger. We put debug on and when running the program ...

+ Reply to Thread
Results 1 to 12 of 12

Thread: Trigger help please

  1. Trigger help please

    Hi all

    I have a problem with some trgiggers not firing.

    FILEA in LIBRARYA with TRIGGER1/2 enabled works beautifully.

    FILEA in LIBRARYB with TRIGGER1/2 enabled does not even fire the
    trigger.

    We put debug on and when running the program against FILEA in LIBRARYA
    the trigger CL is called and works.

    With debug on and running the program against FILEA in LIBRARYB the
    trigger CL is not called.

    This is the same for both library A and B.
    Time Event Status Trigger Program
    *BEFORE *INSERT *ENABLED NVSTLIB/SZT010CL
    *BEFORE *UPDATE *ENABLED NVSTLIB/SZT010CL

    It is an RPG/CL trigger and we are running V5R2M0.

    Does anyone have any idea while a trigger will not fire?

    Thanks, in advance, for any help.

    Neil


  2. Re: Trigger help please

    On Nov 6, 11:41 am, Newbie_Neil wrote:
    > Hi all
    >
    > I have a problem with some trgiggers not firing.
    >
    > FILEA in LIBRARYA with TRIGGER1/2 enabled works beautifully.
    >
    > FILEA in LIBRARYB with TRIGGER1/2 enabled does not even fire the
    > trigger.
    >
    > We put debug on and when running the program against FILEA in LIBRARYA
    > the trigger CL is called and works.
    >
    > With debug on and running the program against FILEA in LIBRARYB the
    > trigger CL is not called.
    >
    > This is the same for both library A and B.
    > Time Event Status Trigger Program
    > *BEFORE *INSERT *ENABLED NVSTLIB/SZT010CL
    > *BEFORE *UPDATE *ENABLED NVSTLIB/SZT010CL
    >
    > It is an RPG/CL trigger and we are running V5R2M0.
    >
    > Does anyone have any idea while a trigger will not fire?
    >
    > Thanks, in advance, for any help.
    >
    > Neil


    if you do a dspfd on filea in libraryb does it show you the trigger??
    If not I think you need to do a GO CMDTRG and take option 1 or 2.


  3. Re: Trigger help please

    Hi

    > if you do a dspfd on filea in libraryb does it show you the trigger??


    Yes, they're both there, *INSERT BEFORE and *UPDATE BEFORE, as
    *ENABLED and *OPERATIVE.

    Effectively, the program is updating the file without the trigger
    being actioned.

    Thanks
    Neil

    PS Sorry for the caps.


  4. Re: Trigger help please

    On Nov 7, 7:34 am, Newbie_Neil wrote:
    > Hi
    >
    > > if you do a dspfd on filea in libraryb does it show you the trigger??

    >
    > Yes, they're both there, *INSERT BEFORE and *UPDATE BEFORE, as
    > *ENABLED and *OPERATIVE.
    >
    > Effectively, the program is updating the file without the trigger
    > being actioned.
    >
    > Thanks
    > Neil
    >
    > PS Sorry for the caps.


    Library list issue??


  5. Re: Trigger help please

    >
    > Library list issue??


    Are you sure that "LIBRARYB" is in your Library List when the job is
    running? Before you run your program on a command line you can type
    'edtlibl' to see whats in the list and add or take librarys out of the
    list. If you know the library is not is the library list you can use
    the 'addlible' command on a command line or in CL to add the library
    to your library list.

    that 1 guy



  6. Re: Trigger help please

    Hi both

    Yes, it's definitely in the library list.

    The software being used is identical. The libraries are using
    identical files.

    The difference is that USERA has LIBRARYA as the current library in
    the user profile. Whilst USERB has LIBRARYB.

    Cheers
    Baffled Neil


  7. Re: Trigger help please

    On Nov 8, 8:31 am, Newbie_Neil wrote:
    > Hi both
    >
    > Yes, it's definitely in the library list.
    >
    > The software being used is identical. The libraries are using
    > identical files.
    >
    > The difference is that USERA has LIBRARYA as the current library in
    > the user profile. Whilst USERB has LIBRARYB.
    >
    > Cheers
    > Baffled Neil


    Could be security issue?? I would double check your liblist on the
    one that is not working and once the library list is how you want it
    remove/add the trigger again and then see what the result is. What
    are you calling to envoke the trigger(Cl, RPG, etc??) Is there any
    OVRDBF happening prior to trigger running??



  8. Re: Trigger help please

    Isn't it that the library list has no effect on triggers? Seems to me that
    if you do a DSPFD and look at the trigger you'll find the library specified
    explictly. If you simple used CRTDUPOBJ to copy the file to the second
    library, the new file will still be using the original trigger. This, of
    course, may be irrelevent, since I don't exactly recall the beginning of
    this thread.

    Sam


    "Newbie_Neil" wrote in message
    news:1194528669.983081.20140@q5g2000prf.googlegrou ps.com...
    > Hi both
    >
    > Yes, it's definitely in the library list.
    >
    > The software being used is identical. The libraries are using
    > identical files.
    >
    > The difference is that USERA has LIBRARYA as the current library in
    > the user profile. Whilst USERB has LIBRARYB.
    >
    > Cheers
    > Baffled Neil
    >




  9. Re: Trigger help please

    You should dblcheck the joblog of the job that does not
    fire the trigger.

    Martin

  10. Re: Trigger help please

    Hi Martin

    > You should dblcheck the joblog of the job that does not
    > fire the trigger.


    There is no joblog.

    The user profiles have identical authorities and there are no object
    security issues.

    >Seems to me that if you do a DSPFD and look at the trigger you'll find the library >specified explicity.


    Correct. Both triggers are enabled.

    >If you simple used CRTDUPOBJ to copy the file to the second
    >library, the new file will still be using the original trigger.


    The same files are in both libraries, but the contents will be
    different.

    They are using the same software, RPG and CL, with the different data
    libraries being set in the user profile.

    Cheers,
    Neil


  11. Re: Trigger help please

    Hi Martin

    > You should dblcheck the joblog of the job that does not fire the trigger.


    Sorry, I meant to say that there were no errors.

    Cheers
    Neil


  12. Re: Trigger help please

    What cumulative PTF level & DB fixpack level? Is the I/O directly on
    the Physical file with the trigger, or via an LF?

    Using debug on the program doing the I/O, at the breakpoint just
    before the I/O issue TRCJOB *ON MAXSTG(9000), and then issue the request
    TRCJOB *OFF OUTPUT(*PRINT) at the breakpoint just after the I/O. Then
    issue DSPSPLF QPSRVTRC SPLNBR(*LAST) and scan for the string: SZT010CL
    Or simply use STRDBG NVSTLIB/SZT010CL UPDPROD(as_necessary) followed
    by ADDBKP '/1' before the I/O.
    If the string is found in the first case, or the breakpoint is hit in
    the second, then the trigger program was called.

    Regards, Chuck
    --
    All comments provided "as is" with no warranties of any kind
    whatsoever and may not represent positions, strategies, nor views of my
    employer

    Newbie_Neil wrote:
    > I have a problem with some triggers not firing.
    >
    > FILEA in LIBRARYA with TRIGGER1/2 enabled works beautifully.
    >
    > FILEA in LIBRARYB with TRIGGER1/2 enabled does not even fire the
    > trigger.
    >
    > We put debug on and when running the program against FILEA in LIBRARYA
    > the trigger CL is called and works.
    >
    > With debug on and running the program against FILEA in LIBRARYB the
    > trigger CL is not called.
    >
    > This is the same for both library A and B.
    > Time Event Status Trigger Program
    > *BEFORE *INSERT *ENABLED NVSTLIB/SZT010CL
    > *BEFORE *UPDATE *ENABLED NVSTLIB/SZT010CL
    >
    > It is an RPG/CL trigger and we are running V5R2M0.
    >
    > Does anyone have any idea why a trigger will not fire?


+ Reply to Thread