× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 5/19/2015 2:49 PM, Singh, Ashwani (Lake Mary) wrote:
This is what I am trying to do -

We have one control record running into multiple records of flat file i.e.

X:01 A|B|C"
X:02 D|E|F"
X:03 G|H|I

X:01 1|2|3|4|5
X:02 ......


And i know that this record X:01 should contain 5 field's but have 2 missing and rest all are fine.

The output becomes like this

X: A|B|C||D|E|E|G|H|I

This whole process is repeated like this...

Please send me the codes for reading directly form IFS and other suggestion you have..

My guess from this is that you have a file coming from a trading partner.
That file goes on the IFS? A Microsoft server?
Then you use FTP or CPYFRMSTMF to get it into a DB2 table?
So that when you're done, you have a very wide, flat DB2 file with some
variable number of characters in the front followed by many spaces?

Definitely try reading the IFS directly. Because stream files do not
have records. They can and do have characters called Carriage Return
and Line Feed which we humans mentally interpret as meaning 'end of
record' but there are no records, only one byte following another in a
stream.

Scott Klement has a tutorial on reading IFS files that is very helpful:
http://www.scottklement.com/rpg/ifs.html

The point of reading from the IFS directly is that you might be able to
completely skip all this scanning simply by properly accumulating the
incoming bytes. Maybe, it's a bit of a guess on my part.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.