CPYTOIMPF .txt file shows garbage on IFS when viewing on windows

35 pts.
Tags:
AS/400
CPYTOIMPF
CPYTOIMPF .txt file shows garbage on IFS when viewing on windows but when using wrklnk it looks fine, please help.Below is the query I am using CPYTOIMPF FROMFILE(BIN815PA) TOSTMF(&PATHDAT) + MBROPT(*ADD) FROMCCSID(*FILE) + STMFCODPAG(285) RCDDLM(*CRLF) + STRDLM(*NONE) FLDDLM(*TAB) CPYTOIMPF FROMFILE(BIN815PB) TOSTMF(&PATHDAT) + MBROPT(*ADD) FROMCCSID(*FILE) + STMFCODPAG(285) RCDDLM(*CRLF) + STRDLM(*NONE) FLDDLM(*TAB) CCSID of the file (BIN815PA) is 285 and the file has all char fields. but the other file (BIN815PB) has CCSID as 65535,has numeric fields as well, Both files are copied to to the IFS folder (&PATHDAT). Issue is when viewing using WRKLNK the merged text file Look OK, but in the windows the text file has garbage values.

Software/Hardware used:
as400

Answer Wiki

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

Have you tried “STMFCODPAG(*PCASCII)”???

Discuss This Question: 8  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
  • BigKat
    are you having the issue with both files or just BIN815PB??
    8,210 pointsBadges:
    report
  • TomLiotta
    ...the other file (BIN815PB) has CCSID as 65535... That CCSID is used when you don't want the encoding to be translated. By definition, BIN815PB is a binary file. When the bytes are copied into the IFS streamfile, they are not converted to code page 285. If you need the encoding to be translated, put the data into a file that has the appropriate CCSID for the data; and then copy that file into your IFS streamfile. Or specify the appropriate FROMCCSID() parameter value on the CPYTOIMPF command. You might get the appropriate CCSID by running RTVJOBA DFTCCSID() and using the value from that. Tom
    125,585 pointsBadges:
    report
  • Satvik
    I don't know the problem lies in which file (BIN815PA or PB) , but I can confirm PA file has all the char fileds with CCSID for all as 285. PB file has mix of numeric + char fields with CCSID as 65535,and further we are mering both these files in one text file to view in IFS.
    35 pointsBadges:
    report
  • TomLiotta
    ...numeric + char fields with CCSID as 65535 Numeric fields don't have a CCSID. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    ...or does that mean it has some numeric fields; and it also has other character fields that have CCSID 65535? Is this a 'program-described' file that actually has just a single field? Substrings might represent 'numeric' or 'character' "fields" in that case. Tom
    125,585 pointsBadges:
    report
  • Satvik
    Hi Tom, The file PB has a mix of numneric and char fields and all the char fields only have CCSID 65535,as numeric fileds do not have any ccsid. Both the files are externally described files with DDS defined. Sanjay
    35 pointsBadges:
    report
  • TomLiotta
    Have you tried "STMFCODPAG(*PCASCII)"??? STMFCODPAG(*PCASCII) will not make any difference. A streamfile code page is already specified, but it doesn't matter because source data file is defined as 65535. The data will not be translated because 65535 is not supposed to translate. The encoding doesn't translate to STMFCODPAG(285) and it doesn't translate to STMFCODPAG(*PCASCII). 65535 doesn't translate, by definition. I'm not sure wht the source data file was created as 65535; but since it was, the things to try first are (1) put the data into a file that has the appropriate CCSID for the data; and then copy that file into your IFS streamfile, and (2) specify the appropriate FROMCCSID() parameter value on the CPYTOIMPF command. If those don't work, then we can try more things. But there is no reason to try anything else until we know if either of those will work. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    Minor added comment -- Technically, STMFCODPAG(*PCASCII) could help given the condition that the data that is in the source data file is already encoded as CCSID 1252 which is what *PCASCII ought to provide. If it's CCSID 1252 data stored as CCSID 65535, then it would still be CCSID data 1252 after the copy. The encoding wouldn't change. 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