|
VADELIA |
SADELIA |
WADELIA |
MADELIA |
|
(I/B) (C/S) |
(B) (S) |
(I/B) (C/S) |
(I) (C/S) |
Section for use
DECLARATION
Syntax
DS Id SeriesDSFields [*POS_BYTE | *POS_CHARACTER]
DS Id *REF_LDM(EntityAccJoin)
Description
This instruction is used to declare a data structure named Id that consists of a series of DS fields. The start position and the type of field can be specified.
With numeric fields, the type is used to determine whether it is packed (P), four-byte binary (B) or extended (the default type).
Management of field start positions when generating in AS/400 Unicode: *POS_BYTE and *POS_CHARACTER
When a starting position is specified, *POS_BYTE can be used to indicate that the position is expressed in bytes, or *POS_CHARACTER to indicate that the position is specified in characters. If this option is not set, the processed position will be adjusted to keep the same alignment relative to the sub-fields as for non-Unicode generation.
Notes:
Be careful how positions are used if the DS is manipulated in an AS/400 server part with Unicode generation.
This option is only available if a field start position is set in the DS declaration.
This option is only relevant with AS400 Unicode generation. The option is ignored on the other platforms.
The *POS_BYTE and *POS_CHARACTER options are mutually exclusive.
Click here for the explanation of the SeriesDSFields element.
You can refer to all the fields in an entity, access or join entity, by using the keyword *REF_LDM followed by the name of an entity, access or join entity.
Notes:
- If the DS declaration is in the local declaration block of a program (a procedure, a control break…), all of its fields must be declared in the same local declaration block.
- If the DS declaration is in a server block, all of its fields must belong to the same server.
Example
DS DataStruc1 CustomerId ItemId
DS DataStruc2 CustomerId,1 ItemId,5 FamCode
DS DataStruc3 CustomerId,B ItemId,P FamCode
DS DataStruc4 CustomerId,1B ItemId,5P FamCode
DS DataStruc5 CustomerId,P ItemId,5B FamCode,10
DS DataStruc6 *REF_LDM(Customer)