What version of OS400 are you running?
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Blake.Moorcroft@xxxxxxxxxx
Sent: Monday, March 02, 2009 2:02 PM
To: Midrange Systems Technical Discussion
Cc: Midrange Systems Technical Discussion;
midrange-l-bounces@xxxxxxxxxxxx
Subject: RE: CPYTOIMPF - extra delimiter issue
Hello Eric...
Tried producing this and WDSC doesn't like it. There are no such
parameters as STRESCCHR and RMVBLANK for this command.
Have a good day.
Blake Moorcroft
Developer - Corporate
Russell A. Farrow Limited
1980 Ambassador Drive, PO Box 333, Windsor, Ontario N9C 3R4
Bus: 519-966-3003 ext. 566, Fax: 519-966-9870 blake.moorcroft@xxxxxxxxxx
"DeLong, Eric" <EDeLong@xxxxxxxxxxxxxxx> Sent by:
midrange-l-bounces@xxxxxxxxxxxx
03/02/2009 02:38 PM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
To
"Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
cc
Subject
RE: CPYTOIMPF - extra delimiter issue
Since you're using DTAFMT(*DLM), you might try this:
CPYTOIMPF FROMFILE(QTEMP/HDCSVDLY)
TOSTMF(&PATH)
MBROPT(*REPLACE)
STMFCODPAG(*PCASCII)
RCDDLM(*CRLF)
DTAFMT(*DLM)
STRDLM(*NONE)
STRESCCHR(*NONE)
RMVBLANK(*TRAILING)
FLDDLM(',')
Specifying STRDLM(*NONE) should keep this tool from adding additional
quotes, since you've already added them to your string image....
The STRESCCHR(*NONE) inhibits imbedded quotes from getting doubled....
RMVBLANKS(*TRAILING) keeps you from sending hundreds of blanks to the
last column of your spreadsheet....
Hth,
Eric DeLong
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Blake.Moorcroft@xxxxxxxxxx
Sent: Monday, March 02, 2009 12:19 PM
To: midrange-l@xxxxxxxxxxxx
Subject: CPYTOIMPF - extra delimiter issue
Hello all...
Has anyone ever run into an issue when building a CSV file from a DB 2
table (created with SQL create statement), where an extra string
delimiter appears in the first column of the csv file.
We are producing a csv file for automatic distribution to a client. The
data base file is populated using an RPG ILE program, with a text string
being populated to a single field in the data base file 1000 characters
long. The string is delimited with commas for fields and double quotes
(") for string fields. The file is then accessed through a CL where the
CPYTOIMPF command is run. The issue arises because a string delimited
(") is appearing at the end of the first character field. This is our
regular string delimiter as defined in the CPYTOIMPF command (listed
below).
CPYTOIMPF FROMFILE(QTEMP/HDCSVDLY) TOSTMF(&PATH) +
MBROPT(*REPLACE) STMFCODPAG(*PCASCII) +
RCDDLM(*CRLF) DTAFMT(*DLM) STRDLM('"') +
FLDDLM(',')
No amount of tweaking or variation appears to get rid of it. We've
tried adjusting the stream code page to *STDASCII, adjusting the
contents of the database field populating the field (a default character
value of '1'
(without the quotes)).
We're now at wits end, and it's becoming a lonely place.
Have a good day.
Blake Moorcroft
Developer - Corporate
Russell A. Farrow Limited
1980 Ambassador Drive, PO Box 333, Windsor, Ontario N9C 3R4
Bus: 519-966-3003 ext. 566, Fax: 519-966-9870 blake.moorcroft@xxxxxxxxxx
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.