ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

López vs. López when bringing down from an FTP server to the IFS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • López vs. López when bringing down from an FTP server to the IFS

    Hi all,

    I have an FTP script that runs and picks up orders from a Linux-based webserver and everything works great.

    However, I see that some orders where the customer name has an accent mark over a letter, that letter gets messed up. When I use FileZilla to FTP into the webserver to look at the file, I see "López". But when I look at the file on the IFS after my program has brought it down, I see "López", and that's also then what ends up in my PF.

    Our system value QCCSID is set to 65535 (I know, I don't like it either)... is that the reason? If so, what options do I have? Or what else should I look at?

    Thanks.

  • #2
    Re: López vs. López when bringing down from an FTP server to the IFS

    Scott put it so clearly here. It helped me a lot.
    Regards

    Kit
    http://www.ecofitonline.com
    DeskfIT - ChangefIT - XrefIT
    ___________________________________
    There are only 3 kinds of people -
    Those that can count and those that can't.

    Comment


    • #3
      Re: López vs. López when bringing down from an FTP server to the IFS

      The data you're sending is encoded with UTF-8 (CCSID 1208). However, somewhere along the line, it is being treated as Latin-1 ASCII (either CCSID 819 or 1252, it's not clear which.)

      The important thing to know is that the computer doesn't know which CCSID your data is. Simply letting the computer 'figure it out' by selecting the default action often results in something like this -- people seem to assume that if they just take the default options and let the OS 'guess' at the CCSID, that it should work... so I think it's important to understand that the computer just doesn't know. Windows has no notion of CCSID, and computers can't read English like you can, so FTP just assigns a default CCSID number (usually CCSID 819) and if that's not what your data is, it just ends up looking wrong.

      PC programs have no notion of CCSID, so FileZilla works because it's guessing at a different CCSID instead of just accepting the default CCSID as IBM i does.

      Please try this:
      1) Take a look at the CCSID assigned to your IFS file. You can do that by doing WRKLNK '/ifs-path-here' and selecting option 8 next to your file.
      2) If the file shows an ASCII CCSID like 819, use CHGATR to change it. CHGATR OBJ('/ifs-path-here') ATR(*CCSID) VALUE(1208)
      3) IF the file shows an EBCDIC CCSID, then the problem is occurring earlier in the process, you will have to set the CCSID during the transfer.

      Once you've set the CCSID, try viewing the data again. Does it look correct?

      Comment


      • #4
        Re: López vs. López when bringing down from an FTP server to the IFS

        Once you've set the CCSID, try viewing the data again. Does it look correct?
        Yes, after changing it from 819 to 1208, it now looks correct.

        FTP just assigns a default CCSID number (usually CCSID 819) and if that's not what your data is, it just ends up looking wrong.
        So, I somehow need to have my FTP script assign CCSID 1208 to the file when it's transferred down?

        Here are the lines from my script that is bringing the file down:

        Code:
        OPEN 'xxx.xxx.xxx.xxx'                           
        USER myusername mypassword            
        ASCII                                                  
        Namefmt 1                                      
        lcd /ecommerce/inbound                         
        GET myfilename.csv
        Last edited by Viking; July 8, 2014, 10:29 AM.

        Comment


        • #5
          Re: López vs. López when bringing down from an FTP server to the IFS

          Instead of using ASCII in the FTP script, try using TYPE C 1208. Hopefully that will create the file with the proper CCSID.

          Comment

          Working...
          X