 




<?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: CL/400 OPNQRYF returning empty records.</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/cl400-opnqryf-returning-empty-records/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/cl400-opnqryf-returning-empty-records/</link>
	<description></description>
	<lastBuildDate>Sat, 25 May 2013 05:16:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: itkr</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/cl400-opnqryf-returning-empty-records/#comment-89835</link>
		<dc:creator>itkr</dc:creator>
		<pubDate>Wed, 23 Mar 2011 14:01:23 +0000</pubDate>
		<guid isPermaLink="false">#comment-89835</guid>
		<description><![CDATA[thanks Tom, that was helpful, I will try that...]]></description>
		<content:encoded><![CDATA[<p>thanks Tom, that was helpful, I will try that&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/cl400-opnqryf-returning-empty-records/#comment-89806</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Tue, 22 Mar 2011 21:23:14 +0000</pubDate>
		<guid isPermaLink="false">#comment-89806</guid>
		<description><![CDATA[The best answer is to fix the program that fails when zero records are selected. That&#039;s the actual problem.

However, you ask about how to determine if any records are available in the CL before calling the problem program. I&#039;m not sure that there is any good way.

One possibility is to try these two commands after your OPNQRYF:&lt;pre&gt;
CPYFRMQRYF FROMOPNID( myqryf ) TOFILE( QTEMP/qryf ) CRTFILE(*YES) NBRRCDS(1)
POSDBF OPNID( myqryf ) POSITION(*START)&lt;/pre&gt;
The CPYFRMQRY command will try to copy one record into a file in QTEMP. It&#039;ll find a record or it won&#039;t. If it doesn&#039;t find any, there will be messages you can test to skip calling the problem program.

The POSDBF command will position the file pointer back to the *START. When you call the problem program, it should be able to read the first record along with any others that follow.

Does that make sense? You&#039;ll want to run some test CL in a small program in order to see how and when the messages will appear.

Tom]]></description>
		<content:encoded><![CDATA[<p>The best answer is to fix the program that fails when zero records are selected. That&#8217;s the actual problem.</p>
<p>However, you ask about how to determine if any records are available in the CL before calling the problem program. I&#8217;m not sure that there is any good way.</p>
<p>One possibility is to try these two commands after your OPNQRYF:
<pre>
CPYFRMQRYF FROMOPNID( myqryf ) TOFILE( QTEMP/qryf ) CRTFILE(*YES) NBRRCDS(1)
POSDBF OPNID( myqryf ) POSITION(*START)</pre>
<p>The CPYFRMQRY command will try to copy one record into a file in QTEMP. It&#8217;ll find a record or it won&#8217;t. If it doesn&#8217;t find any, there will be messages you can test to skip calling the problem program.</p>
<p>The POSDBF command will position the file pointer back to the *START. When you call the problem program, it should be able to read the first record along with any others that follow.</p>
<p>Does that make sense? You&#8217;ll want to run some test CL in a small program in order to see how and when the messages will appear.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: itkr</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/cl400-opnqryf-returning-empty-records/#comment-89772</link>
		<dc:creator>itkr</dc:creator>
		<pubDate>Tue, 22 Mar 2011 10:16:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-89772</guid>
		<description><![CDATA[yes pardon my language, I meant the same.. 

Issue is not with the query, needs no change in that. 

but scenario is during weekends the where condition of that query wont have records to be pulled. This cause the next called pgm fail. So need to change the CL, to have a check condition after this openqry if the select being blank, it should skip the call of a program.

I feel this is simple, sad I&#039;m new !! :(]]></description>
		<content:encoded><![CDATA[<p>yes pardon my language, I meant the same.. </p>
<p>Issue is not with the query, needs no change in that. </p>
<p>but scenario is during weekends the where condition of that query wont have records to be pulled. This cause the next called pgm fail. So need to change the CL, to have a check condition after this openqry if the select being blank, it should skip the call of a program.</p>
<p>I feel this is simple, sad I&#8217;m new !! <img src='http://itknowledgeexchange.techtarget.com/itanswers/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/cl400-opnqryf-returning-empty-records/#comment-89631</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Fri, 18 Mar 2011 18:59:44 +0000</pubDate>
		<guid isPermaLink="false">#comment-89631</guid>
		<description><![CDATA[OPNQRYF doesn&#039;t return records. It only &quot;opens a query file&quot;. Records are returned when programs run RCVF or READ statements or when they issue CPYFRMQRYF against the query file that was opened.

In order for us to suggest possible reasons records might be &quot;blank&quot;, please show code that opens the query file and reads from it.

Also, please clarify &quot;...which sometimes return blank records&quot;. Does that mean that when a program runs it gets some records that have data and others that don&#039;t? Or does it mean that a program can get records with data when it runs one time, but the records are always blank when it runs another time? Do non-blank records ever show up after blank records (assuming the program doesn&#039;t crash)?

Tom]]></description>
		<content:encoded><![CDATA[<p>OPNQRYF doesn&#8217;t return records. It only &#8220;opens a query file&#8221;. Records are returned when programs run RCVF or READ statements or when they issue CPYFRMQRYF against the query file that was opened.</p>
<p>In order for us to suggest possible reasons records might be &#8220;blank&#8221;, please show code that opens the query file and reads from it.</p>
<p>Also, please clarify &#8220;&#8230;which sometimes return blank records&#8221;. Does that mean that when a program runs it gets some records that have data and others that don&#8217;t? Or does it mean that a program can get records with data when it runs one time, but the records are always blank when it runs another time? Do non-blank records ever show up after blank records (assuming the program doesn&#8217;t crash)?</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.041 seconds using memcached
Object Caching 313/319 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-25 06:26:51 -->