Definition and example of a Data Zone

Source: Internet
Author: User
Displaying a data area

You can display the attributes (name, library, type, length, data area text
Description), and the value of a data area. See the CL section of the Programming
Category in the iseries Information Center for a detailed description of
Display data area (dspdtaara) command.

The display uses the 24-digit format with leading zeros suppressed.

Changing a data area

The change data area (chgdtaara) command changes all or part of the value
Of a specified data area. It does not change any other attributes of the data area.
The new value can be a constant or a Cl variable. If the command is in a Cl
Procedure, the data area does not need to exist when the program is created.

Retrieving a data area

The retrieve data area (rtvdtaara) command Retrieves all or part of
Specified data area and copies it into a Cl variable. The data area does not need
Exist at Compilation Time, And the CL variable need not have the same name as
Data area. Note that this command retrieves, but does not alter, the contents of
Specified data area.

Retrieve data area examples
Example 1

Assume that you are using a data area named ordinfo to track the status of
Order file. This data area is designed so that:
* Position 1 contains an O (open), a P (processing), or a C (complete ).
* Position 2 contains an I (in-stock) or an O (out-of-stock ).
* Positions 3 through 5 contain the initials of the Order clerk.

You wowould declare these fields in your procedure as follows:
Dcl var (& ordstat) type (* char) Len (1)
Dcl var (& stockc) type (* char) Len (1)
Dcl var (& Clerk) type (* char) Len (3)

To retrieve the order status into & ordstat, you wocould enter the following:
Copy the content of the data zone to a Cl variable.
Rtvdtaara dtaara (ordinfo (1) rtnvar (& ordstat)

Modify data Zone
Chgdtaara

Generate a data Zone
Crtdtaart

Delete A data Zone
Dltdtaara

Display a data Zone
Dspdtaara

Remote Data Zone
DDM can be used to access the remote data zone. Applications on an as400 need to be modified or obtained in the remote data zone of the as400.
You only need to perform the following operations:
Delete the standard data zone and generate a DDM data zone with the same name,
Rename the standard data Zone
DDM data zone generation
Crtdtaara dtaara (locallib/ddmdtaara) type (* DDM)
Rmtdtaara (remotelib/rmtdtaara) rmtlocname (systemb)
Text ('ddm data Ara to access data area on systemb ')
To use the remote as400 data zone in the Cl program, run the rtvdtaara command to specify the name of the DDM data zone to set the current value.
Put it in program variables. After the modification, put it back in the remote data zone and run the chgdtaara command.
One DDM data Zone

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.