Command reference / object
CHGDTAARA
Change Data Area
Changes the value of the local data area (*LDA), group data area (*GDA), program initialization parameter data area (*PDA), or a data area stored in a library. The new value must match the data area's type and fit within the data area length or the specified substring. For character data areas, only a substring can be changed, leaving the rest of the value intact. When a library data area is changed, it is locked for the duration of the change. Data areas other than *LDA, *GDA, and *PDA can be held across several steps with ALCOBJ.
Allowed environments: *ALL.
Positional parameters: 2.
Restrictions
- To use the command, the user needs *CHANGE authority to the data area and *EXECUTE authority to the library that contains it. No specific authority is needed for *LDA, *GDA, or *PDA.
- The command is conditionally threadsafe. Changing DDM data areas is not threadsafe and fails when more than one thread is active in the job. Changing *LDA, *GDA, or *PDA is allowed only from the initial thread.
Parameters
DTAARA
Data area specification
Specifies the name and library of the data area whose value is being changed. For character data areas only, it can also specify the starting position and length of the substring to change. This is a required parameter.
*LDA- The job's local data area (1024 bytes) is changed.
*GDA- The group data area of a group job (512 bytes) is changed.
*PDA- The program initialization parameter data area of a prestart job (2000 bytes) is changed.
*LIBL- All libraries in the thread's library list are searched until a match is found.
*CURLIB- The thread's current library is used. If none is set, QGPL is used.
*ALL- The entire data area is changed.
Elements in order
Data area
Data area
Suggested / special values:
*LDA, *GDA, *PDA
Qualified parts (object, then library; write LIBRARY/OBJECT)
Data area
Data area
Library
Library
Suggested / special values:
*LIBL, *CURLIB
Substring
Substring
Suggested / special values:
*ALL
Elements in order
Substring starting position
Substring starting position
Substring length
Substring length
VALUE
New value
Specifies the new value stored in the data area. The value must be valid for the data area's attributes. For *CHAR or *LGL data areas, a numeric value must be enclosed in apostrophes. For *DEC data areas, it must not be. This is a required parameter.
Examples
CHGDTAARA DTAARA(MYLIB/MYDATA) VALUE(GOODNIGHT)
Changes data area MYDATA in library MYLIB to GOODNIGHT. The data area must be character data and at least 9 characters long.
CHGDTAARA DTAARA(*LDA (5 4)) VALUE('TWO')
Changes characters 5 through 8 of the local data area. The shorter value is padded with a blank.
Generated from os/cl/catalog/CHGDTAARA.json and os/cl/help/CHGDTAARA.json.