 




<?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: I/O Operations in Program described files</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/io-operations-in-program-described-files/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/io-operations-in-program-described-files/</link>
	<description></description>
	<lastBuildDate>Sun, 19 May 2013 03:14:28 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: shrutigupta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/io-operations-in-program-described-files/#comment-61843</link>
		<dc:creator>shrutigupta</dc:creator>
		<pubDate>Fri, 03 Apr 2009 14:51:24 +0000</pubDate>
		<guid isPermaLink="false">#comment-61843</guid>
		<description><![CDATA[Thanks Martin for your help....it was described so well that i understood it easily....thx again..]]></description>
		<content:encoded><![CDATA[<p>Thanks Martin for your help&#8230;.it was described so well that i understood it easily&#8230;.thx again..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gilly400</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/io-operations-in-program-described-files/#comment-61841</link>
		<dc:creator>gilly400</dc:creator>
		<pubDate>Fri, 03 Apr 2009 13:39:24 +0000</pubDate>
		<guid isPermaLink="false">#comment-61841</guid>
		<description><![CDATA[Hi,

It doesn&#039;t matter about the packed data as long as the file has no fields defined (flat file).  If you tried to copy a flat file to an externally defined file you may get problems if for example you have blanks or character data in the position of a numeric or packed field.  If you copy from an externally defined file to a flat file you won&#039;t have any problems.

The OS checks data that gets copied into externally described files and will issue error messages if the data being copied is invalid for the file field definitions.  Flat files only (normally) have one character field (often with the same name as the file, which means you&#039;d have to use a RENAME in your RPG if you want to use the file as externally described).  Packed data is allowed in character fields, be aware that if you query or dsppfm a file with packed data in a character field the packed data may not be shown unless you display in hex mode (which you can&#039;t do in query).

Regards,

Martin Gilbert.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>It doesn&#8217;t matter about the packed data as long as the file has no fields defined (flat file).  If you tried to copy a flat file to an externally defined file you may get problems if for example you have blanks or character data in the position of a numeric or packed field.  If you copy from an externally defined file to a flat file you won&#8217;t have any problems.</p>
<p>The OS checks data that gets copied into externally described files and will issue error messages if the data being copied is invalid for the file field definitions.  Flat files only (normally) have one character field (often with the same name as the file, which means you&#8217;d have to use a RENAME in your RPG if you want to use the file as externally described).  Packed data is allowed in character fields, be aware that if you query or dsppfm a file with packed data in a character field the packed data may not be shown unless you display in hex mode (which you can&#8217;t do in query).</p>
<p>Regards,</p>
<p>Martin Gilbert.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shrutigupta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/io-operations-in-program-described-files/#comment-61838</link>
		<dc:creator>shrutigupta</dc:creator>
		<pubDate>Fri, 03 Apr 2009 13:16:34 +0000</pubDate>
		<guid isPermaLink="false">#comment-61838</guid>
		<description><![CDATA[I tried both ways, by defining the explicit fields in input specs and by defining the flat record structure, and it doesn&#039;t abend....howcome? Issuing a read on this file means moving packed data to this flat structure....is this permissible?]]></description>
		<content:encoded><![CDATA[<p>I tried both ways, by defining the explicit fields in input specs and by defining the flat record structure, and it doesn&#8217;t abend&#8230;.howcome? Issuing a read on this file means moving packed data to this flat structure&#8230;.is this permissible?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shrutigupta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/io-operations-in-program-described-files/#comment-61835</link>
		<dc:creator>shrutigupta</dc:creator>
		<pubDate>Fri, 03 Apr 2009 13:10:16 +0000</pubDate>
		<guid isPermaLink="false">#comment-61835</guid>
		<description><![CDATA[Hey thanks Martin, this looks quite simple and tidy now :)
I have used CPYF command quite many times, earlier I thought CPYF is some keyword in RPG also, using which file description can be copied....
In the given code, both the input file and output file are specified as flat file. Suppose the input data has a packed field in it, then also the program will work as expected? Won&#039;t in abend?]]></description>
		<content:encoded><![CDATA[<p>Hey thanks Martin, this looks quite simple and tidy now <img src='http://itknowledgeexchange.techtarget.com/itanswers/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
I have used CPYF command quite many times, earlier I thought CPYF is some keyword in RPG also, using which file description can be copied&#8230;.<br />
In the given code, both the input file and output file are specified as flat file. Suppose the input data has a packed field in it, then also the program will work as expected? Won&#8217;t in abend?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gilly400</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/io-operations-in-program-described-files/#comment-61823</link>
		<dc:creator>gilly400</dc:creator>
		<pubDate>Fri, 03 Apr 2009 11:43:04 +0000</pubDate>
		<guid isPermaLink="false">#comment-61823</guid>
		<description><![CDATA[Hi,

I think you&#039;re making it a bit too complicated.  The following should do the trick.  Notice that I put an A for add in the file spec for empoutf and an ADD on the output spec. I changed the write to use EXCEPT and the D (detail time) to and E (exception time) on the output spec.  I removed the D specs completely and replaced the input field definitions with one field for the whole length of the record - the field is also used in the output specs.

FEmployee IF F 39 DISK 
FEmpoutf O A  F 39 DISK
IEmployee NS 
I 1 39 data 
/FREE 
READ EMPLOYEE; 
DOW NOT %EOF; 
EXCEPT EMPOUTF; 
READ EMPLOYEE; 
ENDDO; 
EVAL *INLR = *ON; 
RETURN; 
/END-FREE 
Oempoutf EADD
O data 39 

Hope this makes some sense to you.  I can understand that the use of internally defined files can be quite confusing if you&#039;re used to externally defined files.  All this stuff comes from older (non-AS400) versions of RPG where externally defined files couldn&#039;t be used.

If you come from a System/36 background like me, then internally defined files are almost second nature.

By the way CPYF is an AS/400 (CL) command.  What I meant by using CPYF was that you didn&#039;t really need to write a program at all for this.  If you use CPYF you can copy data from one file to another - it&#039;s a very powerful command which lets you select what data you want to copy, allows creation of a duplicate file if necessary, can clear existing data by using a replace option, etc.

Regards,

Martin Gilbert.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I think you&#8217;re making it a bit too complicated.  The following should do the trick.  Notice that I put an A for add in the file spec for empoutf and an ADD on the output spec. I changed the write to use EXCEPT and the D (detail time) to and E (exception time) on the output spec.  I removed the D specs completely and replaced the input field definitions with one field for the whole length of the record &#8211; the field is also used in the output specs.</p>
<p>FEmployee IF F 39 DISK<br />
FEmpoutf O A  F 39 DISK<br />
IEmployee NS<br />
I 1 39 data<br />
/FREE<br />
READ EMPLOYEE;<br />
DOW NOT %EOF;<br />
EXCEPT EMPOUTF;<br />
READ EMPLOYEE;<br />
ENDDO;<br />
EVAL *INLR = *ON;<br />
RETURN;<br />
/END-FREE<br />
Oempoutf EADD<br />
O data 39 </p>
<p>Hope this makes some sense to you.  I can understand that the use of internally defined files can be quite confusing if you&#8217;re used to externally defined files.  All this stuff comes from older (non-AS400) versions of RPG where externally defined files couldn&#8217;t be used.</p>
<p>If you come from a System/36 background like me, then internally defined files are almost second nature.</p>
<p>By the way CPYF is an AS/400 (CL) command.  What I meant by using CPYF was that you didn&#8217;t really need to write a program at all for this.  If you use CPYF you can copy data from one file to another &#8211; it&#8217;s a very powerful command which lets you select what data you want to copy, allows creation of a duplicate file if necessary, can clear existing data by using a replace option, etc.</p>
<p>Regards,</p>
<p>Martin Gilbert.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shrutigupta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/io-operations-in-program-described-files/#comment-61821</link>
		<dc:creator>shrutigupta</dc:creator>
		<pubDate>Fri, 03 Apr 2009 10:51:06 +0000</pubDate>
		<guid isPermaLink="false">#comment-61821</guid>
		<description><![CDATA[In this particular example how can i populate RECEMP data structure (i.e how to move record from input file to the data structure) as there is no record format name of input file. I am so confused in this program described file...extarnally described file is a way easier than this....but i need to learn these concepts as well....kindly help...]]></description>
		<content:encoded><![CDATA[<p>In this particular example how can i populate RECEMP data structure (i.e how to move record from input file to the data structure) as there is no record format name of input file. I am so confused in this program described file&#8230;extarnally described file is a way easier than this&#8230;.but i need to learn these concepts as well&#8230;.kindly help&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shrutigupta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/io-operations-in-program-described-files/#comment-61820</link>
		<dc:creator>shrutigupta</dc:creator>
		<pubDate>Fri, 03 Apr 2009 10:42:27 +0000</pubDate>
		<guid isPermaLink="false">#comment-61820</guid>
		<description><![CDATA[Ok, I dont know the use of CPYF in RPG program. I will search for it. Thanks.]]></description>
		<content:encoded><![CDATA[<p>Ok, I dont know the use of CPYF in RPG program. I will search for it. Thanks.</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.053 seconds using memcached
Object Caching 355/361 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-19 09:00:14 -->