ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CCSID Issues

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

  • CCSID Issues

    I am a bit new here and these forums have been really helpful for learning about iSeries.

    This problem started about a month ago and I haven't been able to find a solution to it. When converting from CCSID 37 table to 1252 some characters are mistranslated. Like for example É goes from hex 71 > 90 according to windows but when I view it using WRKLNK it says it is C9 and appears properly as 1252 when viewing through terminal. But when viewed from windows it is viewed as x90. I noticed that the characters are correctly matched to CCSID 437 and if I change the CCSID on the file to 437 without translating it appears wrong in AS400 but right in Windows.

    To get around this issue I've tried different things like UTF-8 CCSID 1208 but windows cannot open the file and gives an error message saying unable to open file. Trying to delete it through windows also gives an error and need to delete through Terminal. Luckily none of our clients that prefer UTF-8 require any return files.

    I have spent the last few days on google and asked other members of my team that have been doing this for years and have come up empty handed.

  • #2
    A side note: AS400 was discontinued 19 years ago. iSeries was discontinued 13 years ago. I'm on a crusade to try to get people to stop using these names, please refer to it as IBM i, which it has been for more than a decade now.

    The É character is indeed hex 71 in ccsid 37


    And it is hex C9 in Windows-1252


    Can you explain what you mean by it is '90 according to windows"? You say WRKLNK shows C9, which is the correct value -- so what do you mean by its 90 according to windows? What is causing the change?

    Is it possible that 1252 is not what you're looking for? If so, can you define specifically what you are looking for.

    Comment


    • #3
      Originally posted by Scott Klement View Post
      A side note: AS400 was discontinued 19 years ago. iSeries was discontinued 13 years ago. I'm on a crusade to try to get people to stop using these names, please refer to it as IBM i, which it has been for more than a decade now.
      It seems that Sisyphus might have a better chance with that boulder.

      Comment


      • #4
        Sorry for late response was unable to post replies but could make threads.

        The file is going to be automatically created and sent multiple times a day to another company. When I view the file on the IBM i it appears to be correct 1252, but when I open it with Notepad++ using a hex editor addon it appears to be in 437.

        The other issue is when trying to open a file created with 1208 Notepad++ says it is unable to open the file.

        None of this was happening a couple of months ago on a previous program I created for another problem but the company that receives a file did note about 3 weeks ago there were some strange characters appearing on some of the files. The bulk of our database is in English but as we are in Canada there is still quite a bit of French mixed in. I wouldn't have noticed in my testing if it wasn't for the fact that the French names were getting spelled wrong.

        Sorry about getting the iSeries thing wrong. I never worked on an IBM i, here and the older employees call it AS400 and the younger ones iSeries.

        Comment


        • #5
          How are you creating this file? What causes the translation to 1252 that you say is ending up as 437? Are you translating it yourself, calling an API, using the IFS APIs? Using a command? The more detail you provide, the more we'll be able to help you.

          Comment


          • #6
            I am using CPYTOIMPF with CCSID of 1252 for stream file to create a CSV file based on a database table of CCSID 37. When I view it on the IBM i it displays correctly and states that it is 1252 but if I open the file on Windows from IFS or in Emails it is in 437. I have tried CPYTOSTMF as well with the same results. I was hoping maybe someone changed a setting or something in the IFS as this just started happening all of the sudden.

            Comment


            • #7
              Originally posted by Azsune400 View Post
              I am using CPYTOIMPF with CCSID of 1252 for stream file to create a CSV file based on a database table of CCSID 37. When I view it on the IBM i it displays correctly and states that it is 1252 but if I open the file on Windows from IFS or in Emails it is in 437. I have tried CPYTOSTMF as well with the same results. I was hoping maybe someone changed a setting or something in the IFS as this just started happening all of the sudden.
              Have you tried using *PCASCII as the CCSID parameter of the cpyToImpF command, instead of specifying one?

              Walt

              Comment


              • #8
                Yes I have tried *PCASCII and it returns the same results. It is actually what I normally specify when creating files in the IFS.

                Comment


                • #9
                  Azsume,

                  At a previous job, we were having similar issues to the ones you are encountering.

                  I ended up writing a procedure that first tried *PCASCII to do the cpyToImpF(), and if that failed it would try using *STMF instead.

                  We had no further issues after that.

                  So, you may want to try *STMF, if you have not already.

                  Walt

                  Comment

                  Working...
                  X