Could you make it a tab-delimited file and use CPYFRMIMPF with FLDDLM(*TAB)?


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Versfelt, Charles
Sent: Wednesday, January 11, 2012 11:20 AM
To: midrange-l@xxxxxxxxxxxx
Subject: Copying a CSV file to iSeries as bar delim flat file

Hi,

I have a CL program that copies a CSV file an iSeries flat file using a
simple CPYFRMSTMF statement.

CPYFRMSTMF FROMSTMF('/HOME/CHARLIE/ARAMEX.CSV')
TOMBR('qsys.lib/qtemp.lib/IL201UFL.file/IL201UFL.mbr') MBROPT(*REPLACE)


The program then calls an RPG that parses the flat file, using column
headings to map.
It works... as long as there are no commas in the data!
But, alas, there are commas in the data. So parsing is an issue...

It was suggested I switch to bar delimiters, but as far as I can tell
CPYFRMSTMF doesn't have that option.
When I try to do a CPYFRMIMPF instead...

CPYFRMIMPF FROMSTMF('/HOME/CHARLIE/ARAMEX.CSV') TOFILE(QTEMP/IL201UFL
IL201UFL) RCDDLM(*CRLF) FLDDLM('|') RPLNULLVAL(*FLDDFT) MBROPT(*REPLACE)


I get garbage. I've tried playing with the RCDDLM which has not helped. Is
it not translating the *ASCII to *EBCDIC?

Suggestions?

Thanks,
Charlie

This email has been scanned for viruses by Google Postini Services.

--


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.