<?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"
	>
<channel>
	<title>Comments on: AS/400 iSeries Submitted Job/Batch Record Lock issue</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/as400-iseries-submitted-jobbatch-record-lock-issue/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-iseries-submitted-jobbatch-record-lock-issue/</link>
	<description></description>
	<pubDate>Mon, 09 Nov 2009 04:09:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Sloopy</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-iseries-submitted-jobbatch-record-lock-issue/#comment-58163</link>
		<dc:creator>Sloopy</dc:creator>
		<pubDate>Fri, 28 Nov 2008 10:12:44 +0000</pubDate>
		<guid isPermaLink="false">#comment-58163</guid>
		<description>I tested your code on my system, using the following two programs (file changed to suit our database) :

TSTLCK1 program....

[CODE]
FCUSTL1    UF   E           K DISK    infds(SRWNAM)
D SRWNAM          DS                               
D  Status           *Status                        
                                                   
D Response        S              1    Inz('A')     
                                                   
C     K_CS          KLIST                          
C                   KFLD                    CSSTAT 
C                   KFLD                    CSCUST 
                                                   
C                   EVAL      CSSTAT = 0           
C                   EVAL      CSCUST = 'GBSIMON1'  
                                                   
C                   DOU       Status &#60;&#62; 1218       
                                                   
C* Read the Customer Master Record                 
C     K_CS          CHAIN(E)  CS                                 99
                                                                   
C* Check the File Status, if record was locked, execute subroutine 
C                   IF        %Status(CUSTL1) = 1218               
C     Status        DSPLY     'BLECMD'      Response               
C                   ENDIF                                          
                                                                   
C                   ENDDO                                          
                                                                   
C                   EVAL      *INLR = *ON                          
[/CODE]

TSTLCK2 program....

[CODE]
FCUSTL1    UF   E           K DISK    infds(SRWNAM)                
D SRWNAM          DS                                               
D  Status           *Status                                        
                                                                   
D Response        S              1    Inz('A')                     
                                                                   
C     K_CS          KLIST                                          
C                   KFLD                    CSSTAT                 
C                   KFLD                    CSCUST                 
                                                                   
C                   EVAL      CSSTAT = 0                           
C                   EVAL      CSCUST = 'GBSIMON1'                  
                                                                   
C* Read the Customer Master Record                                 
                                                                   
C     K_CS          CHAIN(E)  CS                                 99
                                                                   
C     Status        DSPLY                   Response               
                                                                   
C                   EVAL      *INLR = *ON  
[/CODE]


Running TSTLCK2 interactively holds the record lock until a reply is entered.

Sending TSTLCK1 to run in batch results in a wait on the locked record (1 minute), then the DSPLY operation sends its message to my message queue requiring a response.

In the batch job, Inquiry Message Reply is *RQD.

So; I can't see any reason why your code should not work in batch. Try using the DSPLY or DUMP operations to see the contents of the STATUS variable; and make sure that there really IS a lock on the record you expect.

Regards,

Sloopy</description>
		<content:encoded><![CDATA[<p>I tested your code on my system, using the following two programs (file changed to suit our database) :</p>
<p>TSTLCK1 program&#8230;.</p>
<pre>
FCUSTL1    UF   E           K DISK    infds(SRWNAM)
D SRWNAM          DS
D  Status           *Status                        

D Response        S              1    Inz(&#8217;A')     

C     K_CS          KLIST
C                   KFLD                    CSSTAT
C                   KFLD                    CSCUST 

C                   EVAL      CSSTAT = 0
C                   EVAL      CSCUST = &#8216;GBSIMON1&#8242;  

C                   DOU       Status &lt;&gt; 1218       

C* Read the Customer Master Record
C     K_CS          CHAIN(E)  CS                                 99

C* Check the File Status, if record was locked, execute subroutine
C                   IF        %Status(CUSTL1) = 1218
C     Status        DSPLY     &#8216;BLECMD&#8217;      Response
C                   ENDIF                                          

C                   ENDDO                                          

C                   EVAL      *INLR = *ON
</pre>
<p>TSTLCK2 program&#8230;.</p>
<pre>
FCUSTL1    UF   E           K DISK    infds(SRWNAM)
D SRWNAM          DS
D  Status           *Status                                        

D Response        S              1    Inz(&#8217;A')                     

C     K_CS          KLIST
C                   KFLD                    CSSTAT
C                   KFLD                    CSCUST                 

C                   EVAL      CSSTAT = 0
C                   EVAL      CSCUST = &#8216;GBSIMON1&#8242;                  

C* Read the Customer Master Record                                 

C     K_CS          CHAIN(E)  CS                                 99

C     Status        DSPLY                   Response               

C                   EVAL      *INLR = *ON
</pre>
<p>Running TSTLCK2 interactively holds the record lock until a reply is entered.</p>
<p>Sending TSTLCK1 to run in batch results in a wait on the locked record (1 minute), then the DSPLY operation sends its message to my message queue requiring a response.</p>
<p>In the batch job, Inquiry Message Reply is *RQD.</p>
<p>So; I can&#8217;t see any reason why your code should not work in batch. Try using the DSPLY or DUMP operations to see the contents of the STATUS variable; and make sure that there really IS a lock on the record you expect.</p>
<p>Regards,</p>
<p>Sloopy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevleemor</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-iseries-submitted-jobbatch-record-lock-issue/#comment-58153</link>
		<dc:creator>Kevleemor</dc:creator>
		<pubDate>Wed, 26 Nov 2008 21:46:03 +0000</pubDate>
		<guid isPermaLink="false">#comment-58153</guid>
		<description>Hi Gil, it is in the HI position to check if the record is not found.  

Kevin</description>
		<content:encoded><![CDATA[<p>Hi Gil, it is in the HI position to check if the record is not found.  </p>
<p>Kevin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gilly400</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-iseries-submitted-jobbatch-record-lock-issue/#comment-58145</link>
		<dc:creator>Gilly400</dc:creator>
		<pubDate>Wed, 26 Nov 2008 16:53:36 +0000</pubDate>
		<guid isPermaLink="false">#comment-58145</guid>
		<description>Hi Kevin,

The job is set to *RQD and it still auto replies to the locked record messages in the joblog?  Which column is your indicator 99 in for your CHAIN opcode?

Regards,

Martin Gilbert.</description>
		<content:encoded><![CDATA[<p>Hi Kevin,</p>
<p>The job is set to *RQD and it still auto replies to the locked record messages in the joblog?  Which column is your indicator 99 in for your CHAIN opcode?</p>
<p>Regards,</p>
<p>Martin Gilbert.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevleemor</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-iseries-submitted-jobbatch-record-lock-issue/#comment-58133</link>
		<dc:creator>Kevleemor</dc:creator>
		<pubDate>Wed, 26 Nov 2008 15:16:53 +0000</pubDate>
		<guid isPermaLink="false">#comment-58133</guid>
		<description>I looked at the Job Definition Attributes of the submitted job, it is set to *RQD.  
[CODE]
Job:   RECORDLOCK     User:   KLM            Number:   246458   
                                                                
Default output queue  . . . . . . . . . . . . . . :   QPRINT    
  Library . . . . . . . . . . . . . . . . . . . . :     QGPL    
Job date  . . . . . . . . . . . . . . . . . . . . :             
Date format . . . . . . . . . . . . . . . . . . . :   *MDY      
Date separator  . . . . . . . . . . . . . . . . . :   /         
Time separator  . . . . . . . . . . . . . . . . . :   :         
Time zone . . . . . . . . . . . . . . . . . . . . :   QN0500EST3
Decimal format  . . . . . . . . . . . . . . . . . :   *BLANK    
Job switches  . . . . . . . . . . . . . . . . . . :             
Inquiry message reply . . . . . . . . . . . . . . :   *RQD      
[/CODE]</description>
		<content:encoded><![CDATA[<p>I looked at the Job Definition Attributes of the submitted job, it is set to *RQD.  </p>
<pre>
Job:   RECORDLOCK     User:   KLM            Number:   246458   

Default output queue  . . . . . . . . . . . . . . :   QPRINT
  Library . . . . . . . . . . . . . . . . . . . . :     QGPL
Job date  . . . . . . . . . . . . . . . . . . . . :
Date format . . . . . . . . . . . . . . . . . . . :   *MDY
Date separator  . . . . . . . . . . . . . . . . . :   /
Time separator  . . . . . . . . . . . . . . . . . :   :
Time zone . . . . . . . . . . . . . . . . . . . . :   QN0500EST3
Decimal format  . . . . . . . . . . . . . . . . . :   *BLANK
Job switches  . . . . . . . . . . . . . . . . . . :
Inquiry message reply . . . . . . . . . . . . . . :   *RQD
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- dynamic -->