ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Change file ro CCSID 37

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

  • Change file ro CCSID 37

    I have to move files to a MS-SQL server. I copy just PF to a special library, then convert the file to CCSID 37 from 65532. 90% of the files convert, but a few do not. I verified there are no logical files of any kind over these files, I am running CHGPF library/file CCSID(37) No errors, log says "file was changed". But its not. Its still at 65532. Suggestions or other methods?

  • #2
    First of all -- do you mean CCSID 65535 ?
    I have never heard og 65532.

    If you had a typo and mean 65535 you should take a look at this link
    Yesterday a guy asked me a question that I have no direct experience with. His system has a QCCSID value of 65535. He wants to know if they can safely change the value to 37. I've never done this, so I told him what I have been told: he can change the value without causing problems. Can anyone speak to this from experience?


    and take notice of the comments from Barbara Morris and Scott Klement.

    Barbara Morris has a reference to an IBM page about the impact of changing QCCSID from shipped 65535 to another CCSID

    Comment


    • #3
      As per the previous post, I don't know what 65532 is and an internet search produced nothing so I'll also assume you mean 65535.

      I don't understand why you think changing the CCSID of the physical file would change the CCSID of the data in the file? As far as I'm aware, changing the CCSID of the PF simply tells the system that the data in the file is this character set, which for most of your files seems to be 37 but for some, it clearly isn't. Even if CHGPF did convert the data, it won't as the CCSID of the file is set to hex (or binary) and as such, the system doesn't know what the data represents. You need to understand what CCSID the data in the file is and set the PF accordingly.
      Last edited by john.sev99; February 13, 2024, 02:36 PM.

      Comment


      • #4
        Thanks for the response. Yes. Is the binary CCSID. But the system is already 37. Its just that files from a 3rd-party application are not (Infor ala Mapics). Most convert just a few do not.

        Comment


        • #5
          If you're trying to CONVERT a file, just changing the CCSID isn't going to do it. You'd need to create a new file and copy from the old one to the new one.

          If the file is a FLAT file (i.e. no fields defined) then you should be able to use CHGPF to SET the CCSID of the file. If fields are defined, the CCSID should be set on each character field, not on the file itself.

          Comment


          • #6
            Be carefull with the flat file if it contains packed fields.

            Comment


            • #7
              Can you tell us what characters are not converted correct?

              Comment


              • #8
                Thanks for all the responses and suggestions!

                I have just under 10,000 files. CHGPF work fine, and SQL queries over it work great, except for a few. On those that don't work, all non-numeric columns show as hex values.
                These are char fields on the IBM P5 server, but all these 3rd-party files are set to CCSID 65535. The data displays as hex until I do the CHGPF, then they look correct. I will have to handle these odd files individually, I guess. I know how to CAST each column, just a pain in the neck. I have to refresh these files every few weeks.

                Comment

                Working...
                X