 




<?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: how to get Page number in specific format in AS400 ( cobol or RPG)</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-page-number-in-specific-format-in-as400-cobol-or-rpg/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-page-number-in-specific-format-in-as400-cobol-or-rpg/</link>
	<description></description>
	<lastBuildDate>Tue, 21 May 2013 09:44:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-page-number-in-specific-format-in-as400-cobol-or-rpg/#comment-101478</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Tue, 10 Jan 2012 20:45:50 +0000</pubDate>
		<guid isPermaLink="false">#comment-101478</guid>
		<description><![CDATA[If it is predictable as CharlieBrowne mentions, then you simply predict it by using whatever gives the correct result, e.g., number of input records. And if it&#039;s not predictable, you&#039;re into Phil&#039;s &quot;none are trivial&quot; cases.

If I had to do it, I would print something like {Page nn of {xx}&quot; on each page. The &quot;nn&quot; would be the actual page number, but the &quot;{xx}&quot; would be some identifiable constant that is guaranteed not to be anywhere else in the output except where the page count is intended to be.

I would generate the output and close the file. Then I would either retrieve the count of pages from the spooled file attributes or I&#039;d grab the value from wherever I stored it in the program.

Finally, I would use the &lt;a href=&quot;http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Fapis%2FQSPGETSP.htm&quot;&gt;Get Spooled File Data (QSPGETSP) API&lt;/a&gt; to get the spooled output into one or more user spaces, and use the appropriate &lt;a href=&quot;http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Fapis%2Fobj5.htm&quot;&gt;User Space APIs&lt;/a&gt; to change each occurrence of &quot;{xx}&quot; to the actual page count, and the &lt;a href=&quot;http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Fapis%2FQSPPUTSP.htm&quot;&gt;Put Spooled File Data (QSPPUTSP) API&lt;/a&gt; to re-spool the output. The temporary original spooled copy could be deleted once the new copy is re-spooled.

Tom]]></description>
		<content:encoded><![CDATA[<p>If it is predictable as CharlieBrowne mentions, then you simply predict it by using whatever gives the correct result, e.g., number of input records. And if it&#8217;s not predictable, you&#8217;re into Phil&#8217;s &#8220;none are trivial&#8221; cases.</p>
<p>If I had to do it, I would print something like {Page nn of {xx}&#8221; on each page. The &#8220;nn&#8221; would be the actual page number, but the &#8220;{xx}&#8221; would be some identifiable constant that is guaranteed not to be anywhere else in the output except where the page count is intended to be.</p>
<p>I would generate the output and close the file. Then I would either retrieve the count of pages from the spooled file attributes or I&#8217;d grab the value from wherever I stored it in the program.</p>
<p>Finally, I would use the <a href="http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Fapis%2FQSPGETSP.htm">Get Spooled File Data (QSPGETSP) API</a> to get the spooled output into one or more user spaces, and use the appropriate <a href="http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Fapis%2Fobj5.htm">User Space APIs</a> to change each occurrence of &#8220;{xx}&#8221; to the actual page count, and the <a href="http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Fapis%2FQSPPUTSP.htm">Put Spooled File Data (QSPPUTSP) API</a> to re-spool the output. The temporary original spooled copy could be deleted once the new copy is re-spooled.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-get-page-number-in-specific-format-in-as400-cobol-or-rpg/#comment-101473</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Tue, 10 Jan 2012 18:46:52 +0000</pubDate>
		<guid isPermaLink="false">#comment-101473</guid>
		<description><![CDATA[There are plenty of discussions of the options in the case where you cannot calculate the number of lines.  None of these solutions are trival,
Phil]]></description>
		<content:encoded><![CDATA[<p>There are plenty of discussions of the options in the case where you cannot calculate the number of lines.  None of these solutions are trival,<br />
Phil</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 6/9 queries in 0.019 seconds using memcached
Object Caching 282/285 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-21 10:13:12 -->