 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Trigger errors</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/trigger-errors/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/trigger-errors/</link>
	<description></description>
	<lastBuildDate>Sat, 25 May 2013 23:02:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/trigger-errors/#comment-75474</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Thu, 01 Apr 2010 22:30:08 +0000</pubDate>
		<guid isPermaLink="false">#comment-75474</guid>
		<description><![CDATA[&lt;i&gt;Just like RPG trigger programs, CL trigger programs have to be coded to receive two input parameters:...&lt;/i&gt;

Although it&#039;s pretty pointless to have a trigger that can&#039;t access the buffers, it is &lt;b&gt;not required&lt;/b&gt; to code the parms unless the &lt;i&gt;language&lt;/i&gt; requires it.

For example, a trigger compiled with CRTBNDCL will work without the parms. It just won&#039;t be able to access the buffer areas. But a program compiled with CRTCLPGM cannot be called successfully if parms are passed and they&#039;re not declared. The CALL will fail with CPD0172 -- Parameters passed on CALL do not match those required. ILE can be more forgiving.

Tom]]></description>
		<content:encoded><![CDATA[<p><i>Just like RPG trigger programs, CL trigger programs have to be coded to receive two input parameters:&#8230;</i></p>
<p>Although it&#8217;s pretty pointless to have a trigger that can&#8217;t access the buffers, it is <b>not required</b> to code the parms unless the <i>language</i> requires it.</p>
<p>For example, a trigger compiled with CRTBNDCL will work without the parms. It just won&#8217;t be able to access the buffer areas. But a program compiled with CRTCLPGM cannot be called successfully if parms are passed and they&#8217;re not declared. The CALL will fail with CPD0172 &#8212; Parameters passed on CALL do not match those required. ILE can be more forgiving.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: toddn2000</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/trigger-errors/#comment-75468</link>
		<dc:creator>toddn2000</dc:creator>
		<pubDate>Thu, 01 Apr 2010 19:46:05 +0000</pubDate>
		<guid isPermaLink="false">#comment-75468</guid>
		<description><![CDATA[Many thanks for the input..

We&#039;ve made some changes and got things working to a point.

The issue now is when I do the RCVF and later call my RPG program it&#039;s says that the record already locked to this job. That should be an easy problem to fix. I think if I just pares out the fields from the input parm and eliminate the RCVF  I should be fine.

Thanks Again

Thanks again.]]></description>
		<content:encoded><![CDATA[<p>Many thanks for the input..</p>
<p>We&#8217;ve made some changes and got things working to a point.</p>
<p>The issue now is when I do the RCVF and later call my RPG program it&#8217;s says that the record already locked to this job. That should be an easy problem to fix. I think if I just pares out the fields from the input parm and eliminate the RCVF  I should be fine.</p>
<p>Thanks Again</p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: littlepd</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/trigger-errors/#comment-75466</link>
		<dc:creator>littlepd</dc:creator>
		<pubDate>Thu, 01 Apr 2010 19:17:09 +0000</pubDate>
		<guid isPermaLink="false">#comment-75466</guid>
		<description><![CDATA[Just like RPG trigger programs, CL trigger programs have to be coded to receive two input parameters: a variable-length parameter containing action info and data from the affected record(s), and a 4-byte bunary value that&#039;s the length of the first parm. Your CL has neither of these.]]></description>
		<content:encoded><![CDATA[<p>Just like RPG trigger programs, CL trigger programs have to be coded to receive two input parameters: a variable-length parameter containing action info and data from the affected record(s), and a 4-byte bunary value that&#8217;s the length of the first parm. Your CL has neither of these.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/trigger-errors/#comment-75465</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Thu, 01 Apr 2010 19:13:32 +0000</pubDate>
		<guid isPermaLink="false">#comment-75465</guid>
		<description><![CDATA[I suspect you have a combination that contributes to the the problem. First, this line of code:&lt;pre&gt;
0018.00 PGM&lt;/pre&gt;
There are no parms declared for the trigger buffer areas. While that&#039;s generally okay for many languages, I suspect also that you have compiled this program as a CLP (i.e., OPM CL) rather than as CLLE (ILE CL). I&#039;m pretty sure that that&#039;s not a valid state for the database to be in.

Now, that&#039;s separate from doing things like changing the library list and trying to delay database processing by DLYJOB or other means; but correcting it should at least allow your testing to progress.

Correction can be either adding appropriate PARM() entries or recompiling as CLLE. Either should work. Both should be done.

Tom]]></description>
		<content:encoded><![CDATA[<p>I suspect you have a combination that contributes to the the problem. First, this line of code:
<pre>
0018.00 PGM</pre>
<p>There are no parms declared for the trigger buffer areas. While that&#8217;s generally okay for many languages, I suspect also that you have compiled this program as a CLP (i.e., OPM CL) rather than as CLLE (ILE CL). I&#8217;m pretty sure that that&#8217;s not a valid state for the database to be in.</p>
<p>Now, that&#8217;s separate from doing things like changing the library list and trying to delay database processing by DLYJOB or other means; but correcting it should at least allow your testing to progress.</p>
<p>Correction can be either adding appropriate PARM() entries or recompiling as CLLE. Either should work. Both should be done.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: toddn2000</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/trigger-errors/#comment-75454</link>
		<dc:creator>toddn2000</dc:creator>
		<pubDate>Thu, 01 Apr 2010 12:56:41 +0000</pubDate>
		<guid isPermaLink="false">#comment-75454</guid>
		<description><![CDATA[Here&#039;s a little more info.

We created a PF, and added a trigger using 
ADDPFTRG FILE(EXTRANET/WCTLH) TRGTIME(*AFTER) TRGEVENT(*INSERT) PGM(EXTRANET/WXTRAOE) TRGLIB(EXTRANET)

We could not add data via a DFU to fire the trigger, we got errors.
If we tried to do an INSERT via SQL, more errors.
Is journaling required on files with a trigger ?

Our trigger program is a CL. I don&#039;t know if that is our problem.
We have triggers only on other RPGLE&#039;s with no issues.
The reason for it being a CL program is in the trigger file, 
we are passing a field for a test/live order.
 
Here&#039;s the CL code, the *HALT* I put in was force the job to stop so I can check
the LIBL of the job running to prevent other corruption and security.
I did this to test each way the trigger can be fired. I want to take a look at the 
active LIBL when the job is running.

0018.00              PGM                                                 
0018.01              DCL         VAR(&amp;YESNO) TYPE(*CHAR) LEN(1)          
0018.02                                                                  
0018.03              DCLF       FILE(WCTLHL) RCDFMT(RF$WCH)              
0018.04                                                                  
0018.05 /* IS THERE A BACKUP RUNNING/ ASYNCS DOWN  */                    
0018.07              RTVDTAARA  DTAARA(BURUNNING) RTNVAR(&amp;YESNO)         
0018.08              IF         COND(&amp;YESNO *EQ &#039;Y&#039;) +                   
0018.09                          THEN(GOTO CMDLBL(ENDJOB))               
0018.10                                                                  
0038.00 /*  IF LOCKED BY ACTUAL EDI PROCESS TRY AGAIN    */ 
0038.01  MAINLOOP:   RTVDTAARA  DTAARA(EDIRUNNING) RTNVAR(&amp;YESNO)        
0048.00              IF         COND(&amp;YESNO *EQ &#039;Y&#039;) THEN(DO)            
0048.01                         DLYJOB DLY(5)                           
0048.02                         GOTO CMDLBL(MAINLOOP)                    
0048.03                         ENDDO                                    
0049.01                                                                  
0049.02 /* SET UP ENVIRONMENT FOR LIVE OR TEST ORDER */                  
0049.03 GET:         RCVF     
0049.05              MONMSG     MSGID(CPF0000) EXEC(GOTO CMDLBL(ENDJOB))    
0049.06                                                                     
0049.07 /*HALT*/     CPYF       FROMFILE(WXOP) TOFILE(TRNLIB/WXOP)          
0049.08                                                                     
0049.09              IF         COND(&amp;WCHTYPE *EQ &#039;LIVE&#039;) THEN(DO)          
0049.10              ADDLIBLE   LIB(MESLIV022) POSITION(*BEFORE MESSYS022)  
0049.11              MONMSG     MSGID(CPF0000)                              
0049.12              ELSE                                                   
0049.13              ADDLIBLE   LIB(MESTST022) POSITION(*BEFORE MESSYS022)  
0049.14              ENDDO                                                  
0049.15                                                                     
0049.16 /* MOVE WEB TICKET DATA FROM EXTRANET INTO PRODUCTION EDI FILES */  
0049.17                                                                     
0054.00              CHGDTAARA  DTAARA(EDIRUNNING) VALUE(&#039;Y&#039;)               
0054.01                                                                     
0054.02              CALL       WCTLORD 
0054.03 ENDJOB:      ENDPGM                                                                              


The errors we are getting are below


Message ID . . . . . . :   SQL7008       Severity . . . . . . . :   30       
Message type . . . . . :   Diagnostic                                        
Date sent  . . . . . . :   03/31/10      Time sent  . . . . . . :   15:32:13 
                                                                             
Message . . . . :   WCTLH in EXTRANET not valid for operation.               
Cause . . . . . :   The reason code is 3.  Reason codes are:                 
    1 -- WCTLH has no members.                                               
    2 -- WCTLH has been saved with storage free.                             
    3 -- WCTLH not journaled, no authority to the journal, or the journal    
  state is *STANDBY.  Files with an RI constraint action of CASCADE, SET NULL
  or SET DEFAULT must be journaled to the same journal.                      
    4 and 5 -- WCTLH is in or being created into production library but the  
  user has debug mode UPDPROD(*NO).                                          
    6 -- Schema being created, but user in debug mode with UPDPROD(*NO).     
    7 -- A based-on table used in creation of a view is not valid. Either the
  table is program described table or it is in a temporary schema.          


Message ID . . . . . . :   CPF4328       Severity . . . . . . . :   50         
Message type . . . . . :   Escape                                              
Date sent  . . . . . . :   03/31/10      Time sent  . . . . . . :   15:40:03   
                                                                               
Message . . . . :   Member WCTLH not journaled to journal *N.                  
Cause . . . . . :   Member WCTLH file WCTLH in library EXTRANET is not         
  journaled to journal *N in library *N for commitment definition *DFTACTGRP.  
    The journal specified is used by commitment definition *DFTACTGRP. If *N   
  is specified for the journal, the file is not journaled. If the file is a    
  logical file, all based-on physical files may not be journaled to the same   
  journal as required by commitment control.                                   
Recovery  . . . :   Ensure the file being opened is journaled. For logical     
  files, make sure that the based-on physical files are journaled to the same  
  journal.                                                                     
Technical description . . . . . . . . :   The commitment definition identifier 
  is X&#039;5CC4C6E3C1C3E3C7D9D7&#039;.


Message ID . . . . . . :   CPF502B       Severity . . . . . . . :   30         
Message type . . . . . :   Sender copy                                         
Date sent  . . . . . . :   03/31/10      Time sent  . . . . . . :   15:40:05   
                                                                               
Message . . . . :   Error occurred in trigger program.                         
Cause . . . . . :   The trigger program which was called as the result of a    
  database insert, update, delete, or read operation failed. See the previous  
  messages in the job log to determine the error. The failing trigger program  
  is WXTRAOE in library EXTRANET type *SYS.  The failing trigger is defined on 
  file WCTLH in library EXTRANET.                                              
Recovery  . . . :   Correct the error in the trigger program. Then try your    
  request again.                                                               
Possible choices for replying to message . . . . . . . . . . . . . . . :       
  C -- The request is canceled.                                                
  I -- The request is ignored.                                                 
                                                                               
                                                                        Bottom 

Message ID . . . . . . :   SQL0443       Severity . . . . . . . :   30        
Message type . . . . . :   Diagnostic                                         
Date sent  . . . . . . :   03/31/10      Time sent  . . . . . . :   15:40:05  
                                                                              
Message . . . . :   Trigger program or external routine detected an error.    
Cause . . . . . :   Either a trigger program, external procedure, or external 
  function detected and returned an error to SQL. If the error occurred in a  
  trigger program, the trigger was on table WCTLH in schema EXTRANET. If the  
  error occurred in an external procedure or function, the external name is   
  WCTLH in schema EXTRANET.  The associated text is *AFTER *INSERT.  If the   
  error occurred in a trigger program, the associated text is the type of     
  trigger program.  If the error occurred in an external function, the        
  associated text is the text of the error message returned from the external 
  function.                                                                   
Recovery  . . . :   Refer to the joblog for more information regarding the    
  detected error. Correct the error and try the request again.                
                                                                        Bottom

We have since tried another way.
using the SQL Create Table. Adding the trigger via the Navigator and are going to try again today.]]></description>
		<content:encoded><![CDATA[<p>Here&#8217;s a little more info.</p>
<p>We created a PF, and added a trigger using<br />
ADDPFTRG FILE(EXTRANET/WCTLH) TRGTIME(*AFTER) TRGEVENT(*INSERT) PGM(EXTRANET/WXTRAOE) TRGLIB(EXTRANET)</p>
<p>We could not add data via a DFU to fire the trigger, we got errors.<br />
If we tried to do an INSERT via SQL, more errors.<br />
Is journaling required on files with a trigger ?</p>
<p>Our trigger program is a CL. I don&#8217;t know if that is our problem.<br />
We have triggers only on other RPGLE&#8217;s with no issues.<br />
The reason for it being a CL program is in the trigger file,<br />
we are passing a field for a test/live order.</p>
<p>Here&#8217;s the CL code, the *HALT* I put in was force the job to stop so I can check<br />
the LIBL of the job running to prevent other corruption and security.<br />
I did this to test each way the trigger can be fired. I want to take a look at the<br />
active LIBL when the job is running.</p>
<p>0018.00              PGM<br />
0018.01              DCL         VAR(&amp;YESNO) TYPE(*CHAR) LEN(1)<br />
0018.02<br />
0018.03              DCLF       FILE(WCTLHL) RCDFMT(RF$WCH)<br />
0018.04<br />
0018.05 /* IS THERE A BACKUP RUNNING/ ASYNCS DOWN  */<br />
0018.07              RTVDTAARA  DTAARA(BURUNNING) RTNVAR(&amp;YESNO)<br />
0018.08              IF         COND(&amp;YESNO *EQ &#8216;Y&#8217;) +<br />
0018.09                          THEN(GOTO CMDLBL(ENDJOB))<br />
0018.10<br />
0038.00 /*  IF LOCKED BY ACTUAL EDI PROCESS TRY AGAIN    */<br />
0038.01  MAINLOOP:   RTVDTAARA  DTAARA(EDIRUNNING) RTNVAR(&amp;YESNO)<br />
0048.00              IF         COND(&amp;YESNO *EQ &#8216;Y&#8217;) THEN(DO)<br />
0048.01                         DLYJOB DLY(5)<br />
0048.02                         GOTO CMDLBL(MAINLOOP)<br />
0048.03                         ENDDO<br />
0049.01<br />
0049.02 /* SET UP ENVIRONMENT FOR LIVE OR TEST ORDER */<br />
0049.03 GET:         RCVF<br />
0049.05              MONMSG     MSGID(CPF0000) EXEC(GOTO CMDLBL(ENDJOB))<br />
0049.06<br />
0049.07 /*HALT*/     CPYF       FROMFILE(WXOP) TOFILE(TRNLIB/WXOP)<br />
0049.08<br />
0049.09              IF         COND(&amp;WCHTYPE *EQ &#8216;LIVE&#8217;) THEN(DO)<br />
0049.10              ADDLIBLE   LIB(MESLIV022) POSITION(*BEFORE MESSYS022)<br />
0049.11              MONMSG     MSGID(CPF0000)<br />
0049.12              ELSE<br />
0049.13              ADDLIBLE   LIB(MESTST022) POSITION(*BEFORE MESSYS022)<br />
0049.14              ENDDO<br />
0049.15<br />
0049.16 /* MOVE WEB TICKET DATA FROM EXTRANET INTO PRODUCTION EDI FILES */<br />
0049.17<br />
0054.00              CHGDTAARA  DTAARA(EDIRUNNING) VALUE(&#8216;Y&#8217;)<br />
0054.01<br />
0054.02              CALL       WCTLORD<br />
0054.03 ENDJOB:      ENDPGM                                                                              </p>
<p>The errors we are getting are below</p>
<p>Message ID . . . . . . :   SQL7008       Severity . . . . . . . :   30<br />
Message type . . . . . :   Diagnostic<br />
Date sent  . . . . . . :   03/31/10      Time sent  . . . . . . :   15:32:13 </p>
<p>Message . . . . :   WCTLH in EXTRANET not valid for operation.<br />
Cause . . . . . :   The reason code is 3.  Reason codes are:<br />
    1 &#8212; WCTLH has no members.<br />
    2 &#8212; WCTLH has been saved with storage free.<br />
    3 &#8212; WCTLH not journaled, no authority to the journal, or the journal<br />
  state is *STANDBY.  Files with an RI constraint action of CASCADE, SET NULL<br />
  or SET DEFAULT must be journaled to the same journal.<br />
    4 and 5 &#8212; WCTLH is in or being created into production library but the<br />
  user has debug mode UPDPROD(*NO).<br />
    6 &#8212; Schema being created, but user in debug mode with UPDPROD(*NO).<br />
    7 &#8212; A based-on table used in creation of a view is not valid. Either the<br />
  table is program described table or it is in a temporary schema.          </p>
<p>Message ID . . . . . . :   CPF4328       Severity . . . . . . . :   50<br />
Message type . . . . . :   Escape<br />
Date sent  . . . . . . :   03/31/10      Time sent  . . . . . . :   15:40:03   </p>
<p>Message . . . . :   Member WCTLH not journaled to journal *N.<br />
Cause . . . . . :   Member WCTLH file WCTLH in library EXTRANET is not<br />
  journaled to journal *N in library *N for commitment definition *DFTACTGRP.<br />
    The journal specified is used by commitment definition *DFTACTGRP. If *N<br />
  is specified for the journal, the file is not journaled. If the file is a<br />
  logical file, all based-on physical files may not be journaled to the same<br />
  journal as required by commitment control.<br />
Recovery  . . . :   Ensure the file being opened is journaled. For logical<br />
  files, make sure that the based-on physical files are journaled to the same<br />
  journal.<br />
Technical description . . . . . . . . :   The commitment definition identifier<br />
  is X&#8217;5CC4C6E3C1C3E3C7D9D7&#8242;.</p>
<p>Message ID . . . . . . :   CPF502B       Severity . . . . . . . :   30<br />
Message type . . . . . :   Sender copy<br />
Date sent  . . . . . . :   03/31/10      Time sent  . . . . . . :   15:40:05   </p>
<p>Message . . . . :   Error occurred in trigger program.<br />
Cause . . . . . :   The trigger program which was called as the result of a<br />
  database insert, update, delete, or read operation failed. See the previous<br />
  messages in the job log to determine the error. The failing trigger program<br />
  is WXTRAOE in library EXTRANET type *SYS.  The failing trigger is defined on<br />
  file WCTLH in library EXTRANET.<br />
Recovery  . . . :   Correct the error in the trigger program. Then try your<br />
  request again.<br />
Possible choices for replying to message . . . . . . . . . . . . . . . :<br />
  C &#8212; The request is canceled.<br />
  I &#8212; The request is ignored.                                                 </p>
<p>                                                                        Bottom </p>
<p>Message ID . . . . . . :   SQL0443       Severity . . . . . . . :   30<br />
Message type . . . . . :   Diagnostic<br />
Date sent  . . . . . . :   03/31/10      Time sent  . . . . . . :   15:40:05  </p>
<p>Message . . . . :   Trigger program or external routine detected an error.<br />
Cause . . . . . :   Either a trigger program, external procedure, or external<br />
  function detected and returned an error to SQL. If the error occurred in a<br />
  trigger program, the trigger was on table WCTLH in schema EXTRANET. If the<br />
  error occurred in an external procedure or function, the external name is<br />
  WCTLH in schema EXTRANET.  The associated text is *AFTER *INSERT.  If the<br />
  error occurred in a trigger program, the associated text is the type of<br />
  trigger program.  If the error occurred in an external function, the<br />
  associated text is the text of the error message returned from the external<br />
  function.<br />
Recovery  . . . :   Refer to the joblog for more information regarding the<br />
  detected error. Correct the error and try the request again.<br />
                                                                        Bottom</p>
<p>We have since tried another way.<br />
using the SQL Create Table. Adding the trigger via the Navigator and are going to try again today.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/10 queries in 0.039 seconds using memcached
Object Caching 323/329 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-26 00:30:55 -->