× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Angela, you did not mention how you set the trigger! It sounds like you are doing after /  Insert, and what might be happening is that the record is locked by the originating program. What have you done with commitment control and activation groups? Anyway, you might try making this a *BEFORE trigger the after the insert is done by the application, add a commit or a rollback depending on what happened.
 
                      Add Physical File Trigger (ADDPFTRG)                    
                                                                              
 Type choices, press Enter.                                                   
                                                                              
 Physical file  . . . . . . . . .                 Name                        
   Library  . . . . . . . . . . .     *LIBL       Name, *LIBL, *CURLIB        
 Trigger time . . . . . . . . . .                 *BEFORE, *AFTER             
 Trigger event  . . . . . . . . .                 *INSERT, *DELETE, *UPDATE   
 Program  . . . . . . . . . . . .                 Name                        
   Library  . . . . . . . . . . .     *LIBL       Name, *LIBL, *CURLIB        
 Replace trigger  . . . . . . . .   *NO           *NO, *YES                   
 Allow Repeated Change  . . . . .   *NO           *NO, *YES                   
 Threadsafe . . . . . . . . . . .   *UNKNOWN      *UNKNOWN, *NO, *YES         
 Multithreaded job action . . . .   *SYSVAL       *SYSVAL, *MSG, *NORUN, *RUN 
 Trigger update condition . . . .   *ALWAYS       *ALWAYS, *CHANGE  
 
   
                                                                              
-----Original Message-----
From: Angela Wawrzaszek [mailto:awawrzaszek@nucorauburn.com]
Sent: Wednesday, July 11, 2001 07:54
To: 'Midrange Mail List (E-mail)'
Subject: triggers

I am finally having to use triggers,  we have a package software so it wasn't something we used before.  However I am trying to create some new files and the idea of Triggers to kick off an update sounded good.
 
What I have is an AS/400 file that is updated via the web,  it is for order entry.  When the file gets updated/created on the web I fire off the trigger program.  The trigger program actually is a CL that checks a logical over the order file to see if there is any records within the file with a status of A or C,  if so it calls an RPG program to update our real order entry files on our BPCS package.  The problem I have is our actual order entry program on BPCS,  I modified this to also add/change/delete records off of this web file when changes are made through the order entry program.  So when a record is added on BPCS,  I call a CL that does some overrides and then calls the RPG program to add it to the web file.
 
NUC500C is the CL,  I am telling it to add order# 109820 to the web file.   As soon as it adds the record the trigger is fired off and fails.  If I re-call this same command it works file because I am no longer doing an insert on the file.  I have the trigger set for all three conditions  insert, update or delete.  I really do not even need the trigger program to run when it is updated from our BPCS system.  That is why I did the CL to see if any records existed with an A or C status meaning they were FROM the web. 
                                                                           
 call nuc500c ('109820' 'A')                                               
    815 - OVRDBF FILE(ECHQTE) TOFILE(ECHL02) MBR(QUOTE)                    
    816 - OVRDBF FILE(ECLQTE) TOFILE(ECLA08) MBR(QUOTE)                    
    817 - OVRDBF FILE(ESNQTE) TOFILE(ESNL01) MBR(QUOTE)                    
    819 - CALL PGM(NUC500)          /* The CALL command contains parameters
   */                                                                      
 Error occurred in trigger program.                                        
 C                                                                         
 Error occurred in trigger program.                                        
 C                                                                         
 An error in the trigger program was detected after WRITE on file ORDERS.  
 Function check. RNX1024 unmonitored by NUC500 at statement 0000001427,    
   instruction X'0000'.                                                    
 An error in the trigger program was detected after WRITE on file ORDERS (C
                                                                    More...
ss Enter to continue. 
 
                                                                                
ssage ID . . . . . . :   CPF502B       Severity . . . . . . . :   30       
ssage type . . . . . :   Sender copy                                       
te sent  . . . . . . :   07/06/01      Time sent  . . . . . . :   15:37:45 
                                                                           
ssage . . . . :   Error occurred in trigger program.                       
use . . . . . :   The trigger program which was called as the result of a  
database insert, update, or delete operation failed. See the previous      
messages in the job log to determine the error. The error code is 2. This  
error code can be used to determine the trigger which caused the error, as 
follows:                                                                   
  1 -- *BEFORE *INSERT trigger                                             
  2 -- *AFTER *INSERT trigger                                              
  3 -- *BEFORE *UPDATE trigger                                             
  4 -- *AFTER *UPDATE trigger                                              
  5 -- *BEFORE *DELETE trigger  
 
 
 
*********************************
 
If I add/change the file through a DFU and put the   code of  A or C which should kick off the trigger I get the message CPF502B.  It is saying the number of parms passed does not match.  The trigger program NUC500c1 requires NO parms!   
 
I can change/update the file with the trigger removed and then call the trigger program and everything works fine.  
 
 
 
HELP!!! 
 
                                                                                             Angie Wawrzaszek
M.I.S. Department
 

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.