Problem with delimiter in CPYTOIMPF

pts.
Tags:
CL/400
CPYTOIMPF
Pipe symbol
Pipe-Delimited Text File
I have used pipe symbol | as the delimiter to seperate fields.I used this in a DS and moved it to a flat file.From the flat file CPYTOIMPF was used to created a text file and ftpd.The problem is that the | symbol is read as ! in another system.Wat could be the reason

Answer Wiki

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

Hi,

I suspect it’s a problem with the CCSID or Code Page – the FROMCCSID, TOCCSID and STMFCODPAG parameters on the CPYTOIMPF command.

Have you tried specifying *PCASCII or *STDASCII for STMFCODPAG?

Regards,

Martin Gilbert.

Discuss This Question: 9  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
  • I have tried all three and the result is the same...
    0 pointsBadges:
    report
  • philpl1jb
    Some time ago, I remember a similar problem. What we did was to cut and paste the '|' from a pc screen to the editor. That symbol from the terminal emulator keyboard looked the same but had a different hex value. Phil
    49,850 pointsBadges:
    report
  • Teandy
    The way I read your question, it looks like you are adding the pipe symbol to the flat file. I think this may be your problem. Are you creating a flat file because you only need certain fields from the original file? If not, let the CPYTOIMPF insert the pipe symbol for you. CPYTOIMPF FROMFILE(MyFile) + TOSTMF('/IFSFOLDER/FILENAME.TXT') + MBROPT(*REPLACE) STMFCODPAG(*PCASCII) + RCDDLM(*CRLF) STRDLM(*NONE) FLDDLM('|') If you do only need certain fields from the original file, create a work file using DDS that contains only the fields you want. Then use the CPYTOIMPF command as illustrated above.
    5,860 pointsBadges:
    report
  • The reason why i used cpytoimpf is that i want the naming convention to have more than 15 characters.Also i have already used the pipe to seperare the fields in flat file.Now when am doing cpytoimpf there are options like field and string delimiter where i have given a pipe symbol still it reaches the other system as ! I also sent the flat file with pipe delimiter directly thr ftp without using cpytoimpf and the same problem occured.
    0 pointsBadges:
    report
  • philpl1jb
    Apparently you're not the only one. Ihttp://www.dynamoo.com/technical/ebcdic.htm My vertical bar is EBSIDIC 4F and when I FTP a file with it to my PC I get the vertical bar. I think you want to transmit ascii 124 (decimal). So you'll want to check the ASCII conversion table you're using. In the data structure you may want to load it as X'4F' or whatever value the conversion table uses. Phil
    49,850 pointsBadges:
    report
  • I tried transmitting the flat file without using cpytoimpf and there still is a problem. I dont have much idea about things like the ASCII conversion table.A small sample would gretaly help. As of now i have initialised the part of DS with a '|' symbol.A solution would be greatly appreciated.
    0 pointsBadges:
    report
  • philpl1jb
    Well there seems to be trouble in them their translation tables. I'm not sure which translation table you use WrkTbl QASCII <-- an obvious EBCDIC The vertical bar in ASCII is 127 Hex 7c The vertical bar in EBCDIC is 79 Hex 4f | and 90 Hex 5a is ! and 106 Hex 6a is the broken vertical bar My ASCII table shows EBCDIC 6a to 7c but my conversion for 4f works -- I suspect my system isn't using this table. AND -- HERE'S THE KICKER -- 4f to 21 which happens to be ... ! So QASCII will convert vert bar to ! So code your vertial var like this D vert2 s 1 inz(X'6a') It will look like a vertical broken bar on your 400 screen but will convert to a real 7c vertical bar .. maybe. Phil
    49,850 pointsBadges:
    report
  • I declared x'6A' as suggested and it worked.That was a good one.Is 6A the hex value for spilt vertical bar?Am still confused as to why this happened?was it because of conversion from EBCDIC to ASCII.I think this is a rare case correct me if am wrong.
    0 pointsBadges:
    report
  • philpl1jb
    Yes. 6a is the split vert bar. Anyone using the QASCII table as their default would get that conversion unless they change the table. And wayback when I was using the cut and past I must have been on a system using those tables. Phil
    49,850 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