Create a data area

Unlike variables, data areas are objects and must be created before they can be used.

A data area can be created as:

When you create a data area, you can also specify an initial value for the data area. If you do not specify one, the following is assumed:

To create a data area, use the Create Data Area (CRTDTAARA) command. In the following example, a data area is created to pass a customer number from one program to another:

CRTDTAARA  DTAARA(CUST) TYPE(*DEC) +
           LEN(5 0) TEXT('Next customer number')
Related information
Create Data Area (CRTDTAARA) command