Professional Documents
Culture Documents
We store those frequently used values (Data) in a data area which are supposed to be accessed and updated by
different programs.
Note:- Data area is not a file.Though it stores data. Handling of data area in programs and through commands is
entirely different than that of a file.
There's specific type of data area which is local to a job. What do we call it?
Firstly we write CRTDTAARA on the command line and press F4 to see the available options.
• Name of Data area - Enter the name of the data area. Valid values of this field are same as any other
valid name of AS400 Objects.
• Type of the data area -
o Enter *DEC if you have to store numeric only values. Like employee number etc.
o Enter *CHAR if you have to store either character or mixed (Character and numeric)
values. You can separate the character and numeric values through a data structure in an RPG
program.
o Enter *LGL if you have to store a logical value
• Length of the data area - Specify the maximum possible length of the value of the data area. If you
have to store Employe name (15) and Employee Id (5,0) then you should give the length as 20 (15 + 5
etc.).
• Decimal places - Specify the number of decimal places only if you described the type of the data
area as *DEC otherwise leave this field blank
• Initial Value - Specify the initial value of the data area. You may leave this empty as default.
However, do mind the blanks if you are going to save multiple values (Which is very likely) in the data
area.
How to display the current values of a data area.
To display the current value of the data area we use the command DSPDTAARA. To Display the value of the
dataarea we can follow the following steps.
We write the command DSPDTAARA on the command line and take F4. Now fill the values as
below.
We can change the current value or definition of a data area using the command CHGDTAARA . To change a
data area we write the command CHGDTAARA and take F4.
Alternatively, We can use the WRKOBJ command. Enter the name of the data area and object type and library.
Take option 4 and press enter when asked to confirm. (Actually, Option 4 runs the command DLTDTAARA and
passes the required parameters implicitly.)