ADELIA |
|
|
|
|
(I/B) |
|
|
|
|
Section for use
All
Syntax
DS Id Length SeriesDSFields
Description
This instruction enables the declaration of a data communication field (data area) named Id.
To do so, you have to specify a length Length immediately after the DS name.
The data field name must not exceed 6 characters.
Id cannot be declared in the data environment. If it is declared, you should specify *NODEF.
A data field, declared in a prototype, is an external IBM object. This object must exist in the library list when the program is executed.
Adelia only deals with alphanumeric data fields.
However, these fields may consist of numeric subfields.
Click here for the explanation of the SeriesDSFields element.
Note: A data area must be read with the READ_DTAARA instruction and it must be updated with the WRITE_DTAARA instruction (see these instructions), except for the Local Data Area in certain cases, see the DS (Local Data Area) instruction.
To update a data area, the latter must be locked.
The locking is performed when reading:
READ_DTAARA DATA LCK (LCK = LOCK - locked)
or READ_DTAARA DATA *LCK
The data area is unlocked when writing:
WRITE_DTAARA DATA
To test the locking, use the *LOCKED reserved word.
Example
* The name of the data communication field is defined as DTADAT.
* Date format is DDMMCCYY
*
DS DTADAT 8 DATE,1 DAY,1 MONTH,3 YEAR,5 MONTH_YEAR,3
*
*********************
VERIFICATION 01
*********************
READ_DTAARA DTADAT *LCK
IF *LOCKED = '1'
PREPARE_MSG 0090 Z_SELECT_DATE
ERROR
END
DATE = Z_SELECT_DATE
******************
VALIDATION 01
******************
WRITE_DTAARA DTADAT
See also the list of 4GL instructions by topic