AS/400 Trigger program

2550 pts.
Tags:
AS/400
AS/400 triggers
How do I switch an existing trigger to run my version of the current program? I'll spew some details as a comment rather than making a long question.


Software/Hardware used:
as400
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Something like this may work, just change the parms to suit your needs

CHGPFTRG FILE(FILELIB/TRIGGERFILE) TRGTIME(*AFTER) TRGEVENT(*INSERT) 
PGM(MYPGMLIB/MYPGM) RPLTRG(*YES) TRGLIB(EXTRANETST) ALWREPCHG(*YES) 

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • aceofdelts

    We have 2 existing triggers on insert to a PF. Of course, the author is no longer available. I printed existing triggers to get the trigger names - too long so did the dspfd to get the full names. I think I have that but I see no way to be sure.

    So trying to remove the 1 so I can replace it with a trigger that points to my version of the program. I get a "requirements between parameters not satisfied" error.

    Is there something else I need for this ?

    I'm certainly open to using a different process to change the trigger. I just want to use the revised program.

    Yes, I tried to move the current program out of its library but the system wouldn't let me do that.

    2,550 pointsBadges:
    report
  • TheRealRaven
    I get a "requirements between parameters not satisfied" error.

    First thing that would would be the message ID. The text is less helpful since multiple messages can contain the same text and be sent for different reasons.

    And second, when and where do you see the error?
    35,040 pointsBadges:
    report
  • aceofdelts

    The message was CDP0150 - seemed generic

    Got this when trying to remove the existing trigger

    One complication was that the file was in use, so ending all auto-start jobs fixed that

    I also tried using *ALL instead of trying to match the trigger name. That worked, tho it removed both triggers. The good news is it did let me switch the program out after that. I (re)created the 2 triggers and it worked !


    2,550 pointsBadges:
    report
  • TheRealRaven
    The CPD0150 message simply says that a command is entered in an incorrect format. And for us, it means we have to see the command in order to know how to correct it.

    But if you're past it, you possibly aren't needing to follow up. Post the command if you want more.
    35,040 pointsBadges:
    report
  • TheRealRaven
    ...to run my version of the current program?

    If you compile using the same program library/name, your version will be used automatically. You don't need to "do" anything. But exactly when it'll be used will depend on how you created it.

    Whether or not it will be used upon the very next reference will depend on how the program was generated.

    If it's bound to run in a *NEW activation group, it'll be used immediately. If it's a named activation group, it'll be used as soon as that activation group is activated. If it's *CALLER, it'll be used whenever a new calling activation group calls it.

    So, the question should clarified. It sounds like you're removing an existing trigger and replacing it with a different one. That's not the same as simply creating a new version.
    35,040 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: