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
- The user must have object operational and add authority for the library where the data area is placed.
- The command is conditionally threadsafe. Creating DDM data areas in a job that allows multiple threads is not threadsafe, and creating them fails when more than one thread is active in the job.
Parameters
DTAARA
Data area
Names the data area to create and the library where it is created. This parameter is required.
*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
Library
Library
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.
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.
Elements in order
Length
Length
Decimal positions
Decimal positions
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.
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.
*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
Library
Library
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.
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.
DEV
APPC device description
Names the source-system APPC device. The device need not exist at creation time.
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.
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.
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.
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.
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.
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.
Generated from os/cl/catalog/CRTDTAARA.json and os/cl/help/CRTDTAARA.json.