 




<?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: AS/400 COBOL</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/as400-cobol/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-cobol/</link>
	<description></description>
	<lastBuildDate>Fri, 24 May 2013 07:13:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-cobol/#comment-97470</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Wed, 05 Oct 2011 23:08:14 +0000</pubDate>
		<guid isPermaLink="false">#comment-97470</guid>
		<description><![CDATA[If you only want to use a physical file (a &#039;table&#039;) and you program cannot know ahead of time which fields will be used as selection (key) fields out of six possible ones, there are three general possibilities.&lt;ol&gt;
	&lt;li&gt;Use dynamic SQL. Specify a WHERE clause that provides whatever selection criteria is supplied.&lt;/li&gt;&lt;li&gt;Read each each record and use IF-tests to see when records match.&lt;/li&gt;&lt;li&gt;Use OPNQRYF to create a dynamic access path each time.&lt;/li&gt;
&lt;/ol&gt;
In each case, count the records until you reach 10. (With SQL you might use relative positioning.)

I suppose it&#039;s also possible to use the C library functions such as &lt;a href=&quot;http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Frtref%2Frlocate.htm&quot;&gt;_Rlocate() — Position a Record&lt;/a&gt; to retrieve specific records, but it&#039;s not clear how you would use those when no appropriate access path existed (without creating one which seems to violate a &quot;no LFs&quot; rule.)

Tom]]></description>
		<content:encoded><![CDATA[<p>If you only want to use a physical file (a &#8216;table&#8217;) and you program cannot know ahead of time which fields will be used as selection (key) fields out of six possible ones, there are three general possibilities.
<ol>
<li>Use dynamic SQL. Specify a WHERE clause that provides whatever selection criteria is supplied.</li>
<li>Read each each record and use IF-tests to see when records match.</li>
<li>Use OPNQRYF to create a dynamic access path each time.</li>
</ol>
<p>In each case, count the records until you reach 10. (With SQL you might use relative positioning.)</p>
<p>I suppose it&#8217;s also possible to use the C library functions such as <a href="http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Frtref%2Frlocate.htm">_Rlocate() — Position a Record</a> to retrieve specific records, but it&#8217;s not clear how you would use those when no appropriate access path existed (without creating one which seems to violate a &#8220;no LFs&#8221; rule.)</p>
<p>Tom</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.036 seconds using memcached
Object Caching 267/273 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-24 07:35:08 -->