 




<?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: RPG ILE Scan csv file</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/rpg-ile-scan-csv-file/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/rpg-ile-scan-csv-file/</link>
	<description></description>
	<lastBuildDate>Wed, 22 May 2013 05:05:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/rpg-ile-scan-csv-file/#comment-94239</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Thu, 14 Jul 2011 18:54:10 +0000</pubDate>
		<guid isPermaLink="false">#comment-94239</guid>
		<description><![CDATA[It might be better simply to use the &#039;_C_IFS_*()&#039; APIs for all of it.

You could use _C_IFS_fgets() to get a line at a time out of the streamfile. You wouldn&#039;t need to be as concerned about where lines start and end. The API mostly does it all for you.

Tom]]></description>
		<content:encoded><![CDATA[<p>It might be better simply to use the &#8216;_C_IFS_*()&#8217; APIs for all of it.</p>
<p>You could use _C_IFS_fgets() to get a line at a time out of the streamfile. You wouldn&#8217;t need to be as concerned about where lines start and end. The API mostly does it all for you.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: streeter</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/rpg-ile-scan-csv-file/#comment-94233</link>
		<dc:creator>streeter</dc:creator>
		<pubDate>Thu, 14 Jul 2011 16:18:46 +0000</pubDate>
		<guid isPermaLink="false">#comment-94233</guid>
		<description><![CDATA[I figured out what to do.  I scan for the carriage return and then use that postion - 1 for the final segment.

thanks]]></description>
		<content:encoded><![CDATA[<p>I figured out what to do.  I scan for the carriage return and then use that postion &#8211; 1 for the final segment.</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jlatos</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/rpg-ile-scan-csv-file/#comment-94232</link>
		<dc:creator>jlatos</dc:creator>
		<pubDate>Thu, 14 Jul 2011 15:58:24 +0000</pubDate>
		<guid isPermaLink="false">#comment-94232</guid>
		<description><![CDATA[A temporary solution (until you find a proper fix) would be to open the csv file in notepad++ or other text editor that allows you to record macros. Then you can record a macro of you hitting the END key, placing a comma, and hitting the down arrow. Play the macro to end of file and you&#039;re set. Save/close the file and upload as usual. Not a long term solution perhaps, but it could get you going today.]]></description>
		<content:encoded><![CDATA[<p>A temporary solution (until you find a proper fix) would be to open the csv file in notepad++ or other text editor that allows you to record macros. Then you can record a macro of you hitting the END key, placing a comma, and hitting the down arrow. Play the macro to end of file and you&#8217;re set. Save/close the file and upload as usual. Not a long term solution perhaps, but it could get you going today.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: streeter</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/rpg-ile-scan-csv-file/#comment-94228</link>
		<dc:creator>streeter</dc:creator>
		<pubDate>Thu, 14 Jul 2011 14:34:17 +0000</pubDate>
		<guid isPermaLink="false">#comment-94228</guid>
		<description><![CDATA[The reason the last segment is not getting written is because, there is a line terminator in this segment.  How do I get the date, but not the terminator.]]></description>
		<content:encoded><![CDATA[<p>The reason the last segment is not getting written is because, there is a line terminator in this segment.  How do I get the date, but not the terminator.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: streeter</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/rpg-ile-scan-csv-file/#comment-94222</link>
		<dc:creator>streeter</dc:creator>
		<pubDate>Thu, 14 Jul 2011 13:35:57 +0000</pubDate>
		<guid isPermaLink="false">#comment-94222</guid>
		<description><![CDATA[I am using a SQLRPGLE program.  Reads in the IFS .csv file and does a %scan to get each segment to update each appropriate field.  It works great for all segments except the very last one where there is no comma following it.  It loops through each segment by establishing a beginning position right after the comma.


Some of the code is as follows:

DOW fgets( %addr(string):%size(string):File_i) &lt;&gt; *Null;    
  // Fromulate text line and write record...                
  textln = string;                                          
  @pos = 1;                                                 
  @fpos = 0;                                                
  FOR i = 1 to 29;                                          
    @spos = @pos;                                           
    IF %subst(textln:@pos:1) = &#039;&quot;&#039;;                         
      @spos = @spos + 1;                                    
      @fpos = %scan(&#039;&quot;&#039;:textln:@spos) ;                     
      @pos = @fpos + 2;                                     
    ELSE;                                                   
      @fpos = %scan(&#039;,&#039;:textln:@pos);                       
      @pos = @fpos + 1;                                     
    ENDIF;                                                  
    IF @spos &gt;= @fpos;]]></description>
		<content:encoded><![CDATA[<p>I am using a SQLRPGLE program.  Reads in the IFS .csv file and does a %scan to get each segment to update each appropriate field.  It works great for all segments except the very last one where there is no comma following it.  It loops through each segment by establishing a beginning position right after the comma.</p>
<p>Some of the code is as follows:</p>
<p>DOW fgets( %addr(string):%size(string):File_i) &lt;&gt; *Null;<br />
  // Fromulate text line and write record&#8230;<br />
  textln = string;<br />
  @pos = 1;<br />
  @fpos = 0;<br />
  FOR i = 1 to 29;<br />
    @spos = @pos;<br />
    IF %subst(textln:@pos:1) = &#8216;&#8221;&#8216;;<br />
      @spos = @spos + 1;<br />
      @fpos = %scan(&#8216;&#8221;&#8216;:textln:@spos) ;<br />
      @pos = @fpos + 2;<br />
    ELSE;<br />
      @fpos = %scan(&#8216;,&#8217;:textln:@pos);<br />
      @pos = @fpos + 1;<br />
    ENDIF;<br />
    IF @spos &gt;= @fpos;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: charliebrowne</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/rpg-ile-scan-csv-file/#comment-94220</link>
		<dc:creator>charliebrowne</dc:creator>
		<pubDate>Thu, 14 Jul 2011 13:26:31 +0000</pubDate>
		<guid isPermaLink="false">#comment-94220</guid>
		<description><![CDATA[What are you using to do the scan?]]></description>
		<content:encoded><![CDATA[<p>What are you using to do the scan?</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.014 seconds using memcached
Object Caching 338/341 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-22 10:09:22 -->