Use data areas

A data area is an object used to hold data for access by any job running on the system.

A data area can be used whenever you need to store information of limited size, independent of the existence of procedures or files. Typical uses of data areas are:

To create a data area other than a local or group data area, use the Create Data Area (CRTDTAARA) command. By doing this, you create a separate object in a specific library, and you can initialize it to a value. To use the value in a CL procedure or program, use a Retrieve Data Area (RTVDTAARA) command to bring the current value into a variable in your procedure or program. If you change this value in your CL procedure or program and want to return the new value to the data area, use the Change Data Area (CHGDTAARA) command.

To display the current value, use the Display Data Area (DSODTAARA) command. You can delete a data area using the Delete Data Area (DLTDTAARA) command.

You can journal your data areas. This allows you to recover the object to a consistent state, even if the object was in the middle of some change action when the abnormal IPL or crash occurred. Journaling also provides for replication of the data area journal to a remote system (using remote journal for instance). This lets the system reproduce the actions in a similar environment to replicate the application work.

Related information
Create Data Area (CRTDTAARA) command
Retrieve Data Area (RTVDTAARA) command
Change Data Area (CHGDTAARA) command
Display Data Area (DSPDTAARA) command
Delete Data Area (DLTDTAARA) command
Journal management