Command reference / object

CRTDTAARA

Create Data Area

Creates a data area in a library, with its data attributes and an optional initial value, for programs to share within a job or between jobs. Programs read it with RTVDTAARA and change it with CHGDTAARA, and the system prevents two commands changing it at once. Each change is written to auxiliary storage. A data area can be journaled. With TYPE(*DDM) the command creates a reference to a data area on a remote system, used with RTVDTAARA and CHGDTAARA.

Allowed environments: *ALL. Positional parameters: 4.

Restrictions

Parameters

DTAARA Data area

Names the data area to create and the library where it is created. This parameter is required.

Type
*QUAL
Required
Yes
Case
Uppercase
*CURLIB
Created in the current library for the thread, or QGPL if none is set.
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
*CURLIB
Length
10
Case
Uppercase

Suggested / special values: *CURLIB

TYPE Type

Sets the kind of value the data area holds: decimal, character, logical (1 or 0), or a DDM reference. This parameter is required.

Type
*CHAR
Required
Yes
Length
5
Case
Uppercase

Allowed values: *DEC, *CHAR, *LGL, *DDM

*DEC
The data area holds a decimal value.
*CHAR
The data area holds a character string.
*LGL
The data area holds a logical value of 1 or 0.
*DDM
The data area is a DDM reference to a remote data area and remote system.

LEN Length

Sets the length of the value. For decimal types, the decimal positions can be given too. Maximum and default lengths depend on TYPE: decimal up to 24 digits with 9 decimal positions, default 15 digits and 5 decimal positions; character up to 2000, default 32; logical is 1.

Type
*ELEM
Required
No
Case
Uppercase
Elements in order

Length Length

Type
*INT4
Required
No
Range
1 to 2000
Case
Uppercase

Decimal positions Decimal positions

Type
*INT4
Required
No
Default
0
Range
0 to 9
Case
Uppercase

VALUE Initial value

Sets the initial value, which must match TYPE. If omitted, character data area is blanks, and decimal and logical data areas are 0.

Type
*CHAR
Required
No
Length
2000
Case
Mixed case

RMTDTAARA Remote data area

Names the remote data area referenced by a *DDM data area. It need not exist at creation time. Specify its library explicitly.

Type
*QUAL
Required
No
Case
Uppercase
*LIBL
Search the called thread's library list on the target system.
*CURLIB
Use the target thread's current library, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Remote data area Remote data area

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

RMTLOCNAME Remote location

Names the target-system remote location. It must exist when the DDM data area is accessed, but need not exist when it is created.

Type
*CNAME
Required
No
Length
8
Case
Uppercase

Suggested / special values: *RDB

*RDB
Use remote-location information from the relational database entry selected by RDB.

RDB Relational database

Names the relational database directory entry for the target system or ASP group. Required with RMTLOCNAME(*RDB). The entry must exist when the data area is opened.

Type
*NAME
Required
No
Length
10
Case
Uppercase

DEV APPC device description

Names the source-system APPC device. The device need not exist at creation time.

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

Suggested / special values: *LOC

*LOC
Use a device associated with the remote location; the system chooses if there are several.

LCLLOCNAME Local location

Names the local communications location associated with the remote location. An invalid combination causes an escape message on access.

Type
*CNAME
Required
No
Default
*LOC
Length
8
Case
Uppercase

Suggested / special values: *LOC, *NETATR

*LOC
Use the device associated with the remote location.
*NETATR
Use the LCLLOCNAME network attribute.

MODE Mode

Names the communications mode used with the remote location. An invalid location/mode combination causes an escape message when the data area is accessed.

Type
*CNAME
Required
No
Default
*NETATR
Length
8
Case
Uppercase

Suggested / special values: *NETATR

*NETATR
Use the DFTMODE network attribute.

RMTNETID Remote network identifier

Names the network containing the remote location. It is checked when the DDM data area is accessed.

Type
*CNAME
Required
No
Default
*LOC
Length
8
Case
Uppercase

Suggested / special values: *LOC, *NETATR, *NONE

*LOC
Use the network ID associated with the remote location.
*NETATR
Use the LCLNETID network attribute.
*NONE
Do not use a remote network identifier.

TEXT Text 'description'

Gives brief text describing the object, up to 50 characters in apostrophes.

Type
*CHAR
Required
No
Default
*BLANK
Length
50
Case
Mixed case

Suggested / special values: *BLANK

*BLANK
No text is specified.

AUT Authority

Sets public authority for the data area: users without specific authority, not on an authorization list, and whose group profiles lack specific authority.

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

Suggested / special values: *LIBCRTAUT, *CHANGE, *ALL, *USE, *EXCLUDE

*LIBCRTAUT
Use the CRTAUT value of the library the data area is created in.
*CHANGE
All operations except those limited to the owner or object management.
*ALL
All operations except authorization list management; can also change ownership.
*USE
Basic operations such as reading the data area; no changes.
*EXCLUDE
The user cannot access the data area.

Examples

CRTDTAARA DTAARA(TOTSALES) TYPE(*DEC) LEN(15 2) VALUE(0) TEXT('Total sales accumulator')

Creates a 15-digit numeric data area named TOTSALES with two decimal positions and an initial value of 0, in the current library for the thread.

CRTDTAARA DTAARA(CUSTOMER) TYPE(*CHAR) LEN(148) TEXT('Customer name area')

Creates a character data area named CUSTOMER holding up to 148 characters. With no initial value, it is initialized to blanks.

IBM command documentation

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