ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CHGPf

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

  • CHGPf

    I am trying to get the CHGPF command to lose data. Shortening a field will not work as when the system copies back and an overflow occurs, the system will then not implemnt the CHPF. The exclusion of a field is required data loss, so that does not count.
    Anyone know how I can achieve this?
    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.

  • #2
    Re: CHGPf

    CrtDupObj without data
    CHGPF on Duplicate Object
    CpyF from Original Table to Modified Table with *MAP *DROP options
    Replace Original table with Modified Table

    Comment


    • #3
      Re: CHGPF

      Thanks for replying, but it must be purely from the CHGPF command.
      It always pops up the warning that... this action might result in data loss (C I). I'm trying to make it happen but am having no luck.
      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


      • #4
        Re: CHGPf

        Take the "I" option to drop data. I'm not sure what you are trying to do. You do want to drop data, right ?

        Comment


        • #5
          Re: CHGPf

          won't that drop all the data in the field? i don't have time to check it out but i'd write a Q&D program to do the whole ball of wax, CRTDUPOBJ DATA(*NO), CHGPF on the dup file, run RPG to copy the data to the dup file, dltf the original file and rename the dup file to the prod file name...but that's just me
          I'm not anti-social, I just don't like people -Tommy Holden

          Comment


          • #6
            Re: CHGPf

            This seems to be a general warning. (It's the same if you edit the file/field definitions in navigator)
            I always answer with an 'I' and it always works ok. I did a little research yesterday and found that when the field size changes, especially with numerics, one may pick up problem. So last night I changed a numeric field to be smaller and the CHGPF came up with an overflow error when it tries to copy the records back. CHGPF then reverses everything including the changed field size.
            I'm trying to get it to drop data, but keep the new field size.
            Hope i've made myself understood.
            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


            • #7
              Re: CHGPf

              I cannot get it to fail.

              I think it's just IBM's dubious terminology when they refer to data loss. Removing a field in the DDS to me means data removal and not data loss. Theoritically, to keep to standards, they should give this warning when one compiles an existing PF.
              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

              Working...
              X