ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Is there a way to change the length of a data area? (on v7r1)

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

  • Is there a way to change the length of a data area? (on v7r1)

    Is there a way to change the length of a data area? I've got one defined at 100 but would like to expand its content. If there is no command to do so, I'll welcome ideas on a slick way to kinda recreate it without losing data.

  • #2
    To my knowledge you can only do it by deleting and recreating it.
    How you would do that with data retention depends on if this would be done manually, or via some kind of change management tool.

    However any programs that already access the data area might error if the data area is longer than it was at compile time, depending on how they were written (e.g. command RTVDTAARA DTAARA(myDataArea *ALL) RTNVAR(&abcd) )

    Comment


    • #3
      Use a CL program with the steps to do it.
      • CRTDTAARA NewTempAra ..... create a data area with the new length ie 200 bytes
      • RTVDTAARA OldAra ..... retrieve the data into a variable
      • CHGDTAARA NewTempAra ..... save the retrieved values in the variable in the new data area
      • DLTDTAARA OldAra
      • RNMOBJ OBJ(NewTempAra) OBJTYPE(*DTAARA) NEWOBJ(OldAra) Done !!!
      Last edited by Peder Udesen; June 18, 2021, 12:34 AM.

      Comment


      • #4
        Thank you Vectorspace for the confirmation that there isn't a command. Thank you Peder for this suggestion - I'm going to write the program now, and I'll execute it around our backup time to limit impact.

        Comment

        Working...
        X