 




<?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: Bad performance in call command in RPGLE</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/bad-performance-in-call-command-in-rpgle/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/bad-performance-in-call-command-in-rpgle/</link>
	<description></description>
	<lastBuildDate>Thu, 23 May 2013 23:03:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: yorkshireman</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/bad-performance-in-call-command-in-rpgle/#comment-60103</link>
		<dc:creator>yorkshireman</dc:creator>
		<pubDate>Thu, 19 Feb 2009 08:59:58 +0000</pubDate>
		<guid isPermaLink="false">#comment-60103</guid>
		<description><![CDATA[Not much to go on in your question.

You can 
a)   improve the efficiency of the existing structure - as other say, convert and recompile gm B into RPGLE for an immediate gain. 
THen you can alter to a bound call, for another gain.  Then you could look at 

b)  restructuring the code.

The first thing to do (even in RPG/400) is to replace CHAIN with SETLL - huge, huge, performance gain.   
User OPEN FILE B and explicitly leave it open.  you say you are already not setting LR on.  Ensure that PGMB remains in storage. 
If File A is keyed, consider if sequential access would be faster

c) restructuring the environment

If PGM A is running a primary read on FILEA, then calling PGM B to chain to FILE B, then we can infer that File B has a relationship to FILE A.  Can you provide an access path joined across both, perhaps with a select on FILE B data and read THAT as a single operation? 
Or run the join dynamically with SQL, or even good old Query to generate an output file of &#039;only&#039; records where FILE B exists? - building an access path takes place down in the MI layer, and is much more efficient than RPG 

You say you want PGM B to run &#039;like an API&#039; as though you foresee its re-use elsewhere.  Read about service programs and modules, and write it in a form for re-use - as a bound procedure.]]></description>
		<content:encoded><![CDATA[<p>Not much to go on in your question.</p>
<p>You can<br />
a)   improve the efficiency of the existing structure &#8211; as other say, convert and recompile gm B into RPGLE for an immediate gain.<br />
THen you can alter to a bound call, for another gain.  Then you could look at </p>
<p>b)  restructuring the code.</p>
<p>The first thing to do (even in RPG/400) is to replace CHAIN with SETLL &#8211; huge, huge, performance gain.<br />
User OPEN FILE B and explicitly leave it open.  you say you are already not setting LR on.  Ensure that PGMB remains in storage.<br />
If File A is keyed, consider if sequential access would be faster</p>
<p>c) restructuring the environment</p>
<p>If PGM A is running a primary read on FILEA, then calling PGM B to chain to FILE B, then we can infer that File B has a relationship to FILE A.  Can you provide an access path joined across both, perhaps with a select on FILE B data and read THAT as a single operation?<br />
Or run the join dynamically with SQL, or even good old Query to generate an output file of &#8216;only&#8217; records where FILE B exists? &#8211; building an access path takes place down in the MI layer, and is much more efficient than RPG </p>
<p>You say you want PGM B to run &#8216;like an API&#8217; as though you foresee its re-use elsewhere.  Read about service programs and modules, and write it in a form for re-use &#8211; as a bound procedure.</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.040 seconds using memcached
Object Caching 267/273 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-23 23:17:32 -->