× 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.



Are you sure they're using the pipe as the record delimiter? Not the
field delimiter? Pipes are very common as a field delimiter, but I
haven't seen them used to delimit a record!

If it really is a record delimiter, one easy workaround is to ask QShell to transform the pipe character into a linefeed(LF) character. QShell comes with a utility named 'tr' that will translate a character into another character. So you can do this from within QShell:

tr '|' '\n' < /path/to/inputfile > /path/to/outputfile

The input and output files must be two separate files, or you'll have problems. The 'tr' utility in the above example will replace all '|' (pipe) characters with \n, which is a symbolic name for line feed.

After that, CPYFRMIMPF can be used with RCDDLM(*LF)

Having said that... it's a quick, cheap workaround, but not a great solution if you're going to do this on a regular basis, you're much better off writing a program to read the file using the IFS APIs. It'll be faster, require less work from the user, and possibly eliminate the need for a temporary PF.

For a one-off setup, I'd use QShell's 'tr' because it's easier. For a permanent, regular job, I'd use the APIs and do it right.


Reger, Bill wrote:
I downloaded a bunch of stream files via FTP to the IFS. Now I need
to get them tranformed into Native iSeries DB files for further
processing. The kicker is that these stream files use the Pipe
symbol ("|" or Hex 4F) as the record delimiter.

Okay cool, I thought. I'll just use the CPYFRMIMPF command
specifying the Pipe symbol in the RCDDLM keyword. However, a
character value can only be specified with the RCDDLM keyword when
using a FROMFILE parameter. It is not allowed with the FROMSTMF
parameter.

Ummmm, now what do I do?

Bill


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.