Junk characters in CSV conversion through CPYTOIMPF

145 pts.
Tags:
AS/400
CLLE
CPYTOIMPF
CSV
RUNQRY
Hi, I am sending data from iseries to excel through CPYTOIMPF i've used this command in CLLE, in query output there is a char field value is '01.03.2011' but when i see in output by wrklnk temp it shows some junk data in this field . RUNQRY     QRY(ADO150Q) CPYTOIMPF  FROMFILE(ADO150F) TOSTMF(/temp/tst.csv) +                  MBROPT(*REPLACE) STMFCODPAG(*PCASCII) +              RCDDLM(*CRLF) FLDDLM(',') DATFMT(*EUR) can any body suggest ,where i am wrong Thanks

Software/Hardware used:
clle

Answer Wiki

Thanks. We'll let you know when a new response is added.

i observed this working fine v5r3

but i am using v5r4

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    it shows some junk data in this field . Please show us the output from DSPFFD ADO150F for that field. Also, what is your system's QCCSID system value? Tom
    125,585 pointsBadges:
    report
  • Rpgle400tech
    Hi Tom Below is the output of dspffd for that perticular field DT. DT CHAR 10 10 75 BOTH FIELD TEXT . . . . . . . . . . . . . . . : substr(digits(t02.pexp),1,2)||'-'||substr(digits(t CODED CHARACTER SET IDENTIFIER . . . . . : 65535
    145 pointsBadges:
    report
  • TomLiotta
    Below is the output of dspffd for that perticular field DT. Does that field not have a CCSID assigned for it? This looks like the field's CCSID rather than your system's QCCSID: CODED CHARACTER SET IDENTIFIER . . . . . : 65535 A CCSID of 65535 defines the field as binary data. CPYTOIMPF doesn't know what characters to use. Technically, data defined as 65535 cannot be represented as readable/printable characters because that CCSID has no alphabet, no language, no region. It's essentially the same as trying to open an image file with NOTEPAD in Windows. Prior to V5R3, CPYTOIMPF wasn't correctly handling CCSIDs. At V5R3 (and in some V5R3 PTFs), CCSID handling was corrected which brought the need for changes in procedures that used CPYTOIMPF or CPYFRMIMPF on some systems. Systems that didn't have system value QCCSID set to the CCSID that fit the language and region that the system system handled, or that had files that had CCSIDs that weren't defined, needed attention. The V5R3 Memo to Users discusses changes in the CPYFRMIMPF and CPYTOIMPF command changes topic on page 26. Information APAR II13784 provides some additional information and some suggested fixes. In your case, you might create a VIEW over your file and use the VIEW as input to CPYTOIMPF. SQL based on something like this might be used:
    CREATE VIEW mylib/ADO150FV ( DT37 ) AS
          SELECT
                 cast( DT as char (10) CCSID 37 )
             FROM mylib/ADO150F
    I only listed one field -- DT -- which was CAST as CCSID 37 and given the name DT37. You'd want to include all of the fields in the file, and you'd want to CAST each of them away from CCSID 65535 if that's what they had. Also, you would only use CCSID 37 if that's appropriate for your system. You'd use names for the library and the view that meet your requirements. I don't know what your system QCCSID value is yet, so I can't guess what you should use. You might use DSPJOB against your interactive job to see what the system guesses your job CCSID ought to be. Tom
    125,585 pointsBadges:
    report
  • Rpgle400tech
    Thanks Tom, Now its working fine...
    145 pointsBadges:
    report
  • TomLiotta
    i observed this working fine v5r3 but i am using v5r4 That's certainly possible. Without knowing system QCCSID at both V5R3 and V5R4 and job CCSID at both V5R3 and V5R4 (not "Default coded character set identifier") and relevant PTFs at both V5R3 and V5R4 along with a couple other possible elements, there's no certainty of success. Even at V7R1, if configuration is irregular, results are uncertain. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following