i 'm new to as/400.in an interview i was asked this
question.give a practical example for passing information or
data through local data area.
I know only that data area is an object used to store tiny
bits of data or it can store one value at a time and it is
used to store frequently changing values or datas.thats all
i know about data area can any one tell me how local data
area and user defined data area are used to pass data
between jobs with a example or coding.thanks in advance.
Answer Posted / prabhas
Data area is a storage area to store limited information.
Example: a new and unique customer number is generated
whenever a new customer is added to customer master file.
Data area keeps track of last record added and add 1 to it.
Through program we can access new customer number.
To create a data area, use the command CRTDTAARA (Create
Data Area). For example, to create a 100 character data
area named LASTINV#:
CRTDTAARA DTAARA(MYLIB/LASTINV#) TYPE(*CHAR) LEN(100)
Now, load the first 10 positions with the
value "AA12345678" with the CHGDTAARA (Change Data Area)
command
CHGDTAARA DTAARA(QTEMP/LASTINV# (1 10)) VALUE('AA12345678')
Look at the value of the data area with DSPDTAARA (Display
Data Area):
DSPDTAARA MYLIB/LASTINV#
A CL program can retrieve the value with RTVDTAARA. An RPG
program uses the "IN" operation to retrieve the value and
the "OUT" operation to change it.
Is This Answer Correct ? | 6 Yes | 5 No |
Post New Answer View All Answers
Suppose we have one database file and it is used by 5 programs and in 3 program we have to add some records in datbase file s what is the impact on other program?
Set on command is used for closed all opened files , initialize var and release resource , return cmd is used for return to calling program but my req. Is dnt close opened files and resource must released while doing transactions , how can i do this...?
what is kids-rpg?
How can we override a file during runtime in rpg?
what is program status data structure?
what is the procedure and explain about real time scenario.
What is a record lock error?
How to define data area in RPG program? In which scenario multi occurrence DS is use in AS400?
how do I declare a minor?
what is file information data structure?
How to declare the pull button in AS/400..
What are the types of identifiers?
What is the diff bw PF/LF Name and their Record format name? what is restriction in record format then file name?
how do you use commitment control in rpg?
If my rpg program has a date field, what extra care I have to take while compiling that rpg program? If the file is keyed and I have declared the file as well as key list properly in my program. Still am getting an error message like "chain/reade operation is not allowed" what may be the case?