Is it possible to increase the length of an existing data area

560 pts.
Tags:
AS/400
AS/400 database
Dear All! Is it possible to increase the length of an existing data area, without disturbing the values in it? For instance, I have a data area with initial length of 256 with some values already in it. Now that some more fields need to be added to the program (due to enhancement) which writes into the data area, the length of the data area also needs to be increased to 452 length. Now is it possible to increase the length of it, without disturbing the values in it? OR do I need to delete it & re-create another with the new length (of-course with the same name). If so, how do I copy the existing values into the new data area into exactly the same positions? Thanks, Svanky

Software/Hardware used:
DB2/400, CL/400. AS/400

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    I don't know a 'good way' to make the change without deleting and recreating. I would create a basic CL program that renamed the existing *DTAARA, retrieved its content into a variable, created the new *DTAARA with the old name but the new size along with the retrieved data as its initial value, and finally set ownership and authority using the renamed original as a reference object. . Technically, I wouldn't use a *DTAARA with "multiple fields" at all; so there would never be a possibility of "more fields need to be added". That's not a good use of a *DTAARA which ought to contain a single value, though HLLs allow data structure definitions. . If you need a set of fields, use a database record format. . I would probably use a *USRIDX with variable entries. You can add essentially any number of different values to it, each of which has a different definition. It can be extended for any foreseeable future without needing to change many programs that use it. You'd only add new key values to programs that needed the new keys. Every existing *DTAARA in most systems could probably be turned into separate entries in a single *USRIDX. (A *USRIDX could hold essentially two million 2000-byte *DTAARAs, and there'd only be a single object to manage for ownership and authority.) . Tom
    125,585 pointsBadges:
    report
  • svankipu
    Thanks a million!! Tom! I got my answer. - Svanky
    560 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following