CPYFRMIMPF for ansi char
Last Post 22 May 2009 08:31 PM by carole kaufman. 9 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
carole kaufman
New Member
New Member
Posts:22

--
22 May 2009 04:05 PM
How do we use CPYFRMIMPF to import a csv file containing special character words like cafe (with accent over the e). We can import the CSV via Client Access setting it to ANSI, but we don't see an ANSI setting with CPYFRMIMPF. We see you can 'ANSI' via CPYTO, but STMFCODPAG doesn't see to exist in CPYFRM. Surely Client Access is issuing a command when it imports - but what on earth is it?! Any and all help appreciated!
davesmith
Veteran Member
Veteran Member
Posts:1257
Avatar

--
22 May 2009 05:21 PM Accepted Answer
Try [FONT="Courier New"]CPYFRMIMPF FROMCCSID(*PCASCII) ...[/FONT] Dave
carole kaufman
New Member
New Member
Posts:22

--
22 May 2009 05:35 PM Accepted Answer
I got excited there for a second but *PCASCII is not an option for FROMCCSID. Error on compile: *PCASCII ' for parameter FROMCCSID must be numeric.
davesmith
Veteran Member
Veteran Member
Posts:1257
Avatar

--
22 May 2009 06:32 PM Accepted Answer
Oops, sorry. Was mixing CPYTO... with CPYFRM... Just specify the appropriate CCSID. 437 is US PC ascii, 367 is ANSI X3.4 ASCII, 819 is ISO 8859-1 ... Dave
carole kaufman
New Member
New Member
Posts:22

--
22 May 2009 06:40 PM Accepted Answer
Our system is set up as 37, which supports the "special e" as in décor, but you wouldn't know it! instead it comes in a décor - which is special, but not in the way we want. Since we already have CCSID set up.... What's odd is that you can manually upload the csv file and specify ANSI but you can't programmatically do so???
J Taylor
Senior Member
Senior Member
Posts:4007

--
22 May 2009 06:46 PM Accepted Answer
Is the CCSID correct for the file? If not, can't you just specify the correct one?
carole kaufman
New Member
New Member
Posts:22

--
22 May 2009 06:50 PM Accepted Answer
I think so....37 definitely supports the é. We just can't get it supported via csv and the CPYFRMIMPF
J Taylor
Senior Member
Senior Member
Posts:4007

--
22 May 2009 07:08 PM Accepted Answer
I think so....37 definitely supports the é. We just can't get it supported via csv and the CPYFRMIMPF
I was actually talking about the CSV file, not your DB2 table (I should have specified).
Robert Clay
Veteran Member
Veteran Member
Posts:915

--
22 May 2009 07:19 PM Accepted Answer
But, my understanding is that CCSID 37 is English EBCIDIC. Try another CCSID but use an ASCII or Unicode:
CHGATR OBJ('/path/filename.csv') ATR(*CCSID) VALUE(819)

or

CHGATR OBJ('/path/filename.csv') ATR(*CCSID) VALUE(1208)
819 is Latin-1 and 1208 is UTF-8 Unicode. There are lots of other CCSID's out there. Maybe you could play around with them until you find one that works. Here's a list: http://www-01.ibm.com/software/glob...stered.jsp HTH, Robert P.S. There's always Base64... :eek:
"Contrariwise, if it was so, it might be; and if it were so, it would be; but as it isn't, it ain't. That's logic."--Tweedledee
carole kaufman
New Member
New Member
Posts:22

--
22 May 2009 08:31 PM Accepted Answer
Yes! That was it... I've been using the wrong CCSID for UTF-8 (what .net creates). I've been using 1209 (Global) instead of 1208 (IBM version). CCSID 1208 works wonderfully with CPYFRMIMPF command. CHGATR command is not required because .NET already creates the file in UTF-8....but together all the tips got our problem solving geared in the right direction. Thanks so much everyone. Your help saved our weekend for our family!! You're the best!
You are not authorized to post a reply.

Acceptable Use Policy