<?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: CPYTOIMPF removed leading zeros from numeric field</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/cpytoimpf-removed-leading-zeros-from-numeric-field/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/cpytoimpf-removed-leading-zeros-from-numeric-field/</link>
	<description></description>
	<lastBuildDate>Wed, 19 Jun 2013 04:33:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/cpytoimpf-removed-leading-zeros-from-numeric-field/#comment-72269</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Wed, 06 Jan 2010 19:33:47 +0000</pubDate>
		<guid isPermaLink="false">#comment-72269</guid>
		<description><![CDATA[Minor added comment -- once a view is created, that view becomes the file that you name as input to CPYTOIMPF.

Tom]]></description>
		<content:encoded><![CDATA[<p>Minor added comment &#8212; once a view is created, that view becomes the file that you name as input to CPYTOIMPF.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/cpytoimpf-removed-leading-zeros-from-numeric-field/#comment-72223</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Tue, 05 Jan 2010 19:34:39 +0000</pubDate>
		<guid isPermaLink="false">#comment-72223</guid>
		<description><![CDATA[There have been added options to CPYTOIMPF in current releases, starting with V5R4. I don&#039;t think any were PTFed backwards.

For example, you can now specify options for trimming leading/trailing blanks.

In any case, the creation of a view to define how you want columns handled may be your best choice. E.g., &lt;pre&gt;RIGHT(TRIM(&#039;00000&#039; concat CHAR(SEQN)),5)&lt;/pre&gt;...should take a 5-digit numeric &#039;sequence&#039; column and convert the significant digits to characters, then add five zeros to the front, trim the result, and take the five rightmost remaining characters.

Rather than coding the &quot;5&quot; at the end of the RIGHT() function, LENGTH(SEQN) could be used for a NUMERIC column. Using LENGTH(), such a column specification could be generalized more in order to determine how many zeros should be accounted for at the beginning.

The STMFCODPAG() option probably should be *PCASCII, especially when you are creating the streamfile. You have the ability on the AS/400 to do the work in EBCDIC or ASCII, in a bunch of different CCSIDs. Windows can also handle data in most kinds of encoding. But it&#039;s not always clear on how to get the two sides to agree across a network connection.

FTP, for example, commonly transfer in either text or binary mode. In binary, the bits are copied directly. In text, the bit patterns are translated from whatever encoding is on the source system to the encoding on the target system. But FTP handles every record as a single string. It doesn&#039;t recognize when there are different kinds of fields such as packed or binary embedded within the string.

Windows network transfers are similar. If you don&#039;t take care to encode all of each record properly on the AS/400 side, Windows will apply its own rules. By specifying *PCASCII, you are preparing each of the bytes in the expectation that Windows networking (or FTP or some other transfer methods) will be copying the file.

Note that the *PCASCII encoding can also be handled by the AS/400. If you use DSPF to view the streamfile after you create it, it should be perfectly readable.

Tom]]></description>
		<content:encoded><![CDATA[<p>There have been added options to CPYTOIMPF in current releases, starting with V5R4. I don&#8217;t think any were PTFed backwards.</p>
<p>For example, you can now specify options for trimming leading/trailing blanks.</p>
<p>In any case, the creation of a view to define how you want columns handled may be your best choice. E.g.,
<pre>RIGHT(TRIM('00000' concat CHAR(SEQN)),5)</pre>
<p>&#8230;should take a 5-digit numeric &#8216;sequence&#8217; column and convert the significant digits to characters, then add five zeros to the front, trim the result, and take the five rightmost remaining characters.</p>
<p>Rather than coding the &#8220;5&#8243; at the end of the RIGHT() function, LENGTH(SEQN) could be used for a NUMERIC column. Using LENGTH(), such a column specification could be generalized more in order to determine how many zeros should be accounted for at the beginning.</p>
<p>The STMFCODPAG() option probably should be *PCASCII, especially when you are creating the streamfile. You have the ability on the AS/400 to do the work in EBCDIC or ASCII, in a bunch of different CCSIDs. Windows can also handle data in most kinds of encoding. But it&#8217;s not always clear on how to get the two sides to agree across a network connection.</p>
<p>FTP, for example, commonly transfer in either text or binary mode. In binary, the bits are copied directly. In text, the bit patterns are translated from whatever encoding is on the source system to the encoding on the target system. But FTP handles every record as a single string. It doesn&#8217;t recognize when there are different kinds of fields such as packed or binary embedded within the string.</p>
<p>Windows network transfers are similar. If you don&#8217;t take care to encode all of each record properly on the AS/400 side, Windows will apply its own rules. By specifying *PCASCII, you are preparing each of the bytes in the expectation that Windows networking (or FTP or some other transfer methods) will be copying the file.</p>
<p>Note that the *PCASCII encoding can also be handled by the AS/400. If you use DSPF to view the streamfile after you create it, it should be perfectly readable.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rpgldb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/cpytoimpf-removed-leading-zeros-from-numeric-field/#comment-72203</link>
		<dc:creator>rpgldb</dc:creator>
		<pubDate>Tue, 05 Jan 2010 13:55:42 +0000</pubDate>
		<guid isPermaLink="false">#comment-72203</guid>
		<description><![CDATA[Thank you for responding. In the past I have created my own program to handle creating .csv files, and then I used the CPYTOPCD command to move the file to the IFS. However, this time I wanted to give the CPYTOPCD command a try. It is not that I expected the tool to work differently on numerics, but thought perhaps there was an option that I was missing. Also, this doesn&#039;t explain why I have blanks added to the end of the numeric fields. Also, I really don&#039;t have any idea what some of the other options will do for me, such as STMFOCODPAG. I do not do any PC language programming, only RPG on the AS/400. The to file will be FTP to a PC server.]]></description>
		<content:encoded><![CDATA[<p>Thank you for responding. In the past I have created my own program to handle creating .csv files, and then I used the CPYTOPCD command to move the file to the IFS. However, this time I wanted to give the CPYTOPCD command a try. It is not that I expected the tool to work differently on numerics, but thought perhaps there was an option that I was missing. Also, this doesn&#8217;t explain why I have blanks added to the end of the numeric fields. Also, I really don&#8217;t have any idea what some of the other options will do for me, such as STMFOCODPAG. I do not do any PC language programming, only RPG on the AS/400. The to file will be FTP to a PC server.</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.012 seconds using memcached
Object Caching 296/299 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-06-19 06:10:18 -->