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

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.

Type
*ELEM
Required
Yes
Case
Uppercase
*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

Type
*QUAL
Required
No
Case
Uppercase

Suggested / special values: *LDA, *GDA, *PDA

Qualified parts (object, then library; write LIBRARY/OBJECT)

Data area Data area

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

Substring Substring

Type
*ELEM
Required
No
Default
*ALL
Case
Uppercase

Suggested / special values: *ALL

Elements in order

Substring starting position Substring starting position

Type
*INT4
Required
No
Range
1 to 2000
Case
Uppercase

Substring length Substring length

Type
*INT4
Required
No
Range
1 to 2000
Case
Uppercase

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.

Type
*CHAR
Required
Yes
Length
2000
Case
Mixed case

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.

IBM command documentation

Generated from os/cl/catalog/CHGDTAARA.json and os/cl/help/CHGDTAARA.json.