PASCAL DATA TYPE MAPPINGS [ DICTIONARY 3000 ] MPE/iX 5.0 Documentation
DICTIONARY 3000
PASCAL DATA TYPE MAPPINGS
To be compatible with PASCAL, the data types for the extracted entities
as defined in the Dictionary must be mapped to PASCAL data types. The
following shows how the Dictionary data types are mapped to compatible
PASCAL data types. Note that the PASCAL type occupies the same storage
length as the data types defined in the Dictionary. (The storage length
is computed from the ELEMENT-LENGTH and ELEMENT-COUNT entries for an
entity in the Dictionary.)
Any ASCII character:
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = X
ELEMENT-LENGTH = N
The corresponding PASCAL data type will be generated:
CHAR (if N=1) or
PACKED ARRAY[1..N] OF CHAR (if N > 1)
For example, if an entity is defined in the Dictionary as:
ELEMENT = ACCOUNT_NAME
ELEMENT-TYPE = X
ELEMENT-LENGTH = 20
The PASCAL code will be generated as:
ACCOUNT_NAME = PACKED ARRAY[1..20] OF CHAR
Uppercase alphanumeric string:
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = U
ELEMENT-LENGTH = N
The corresponding PASCAL data type will be generated:
' '..'Z' (if N = 1) or
PACKED ARRAY[1..N] OF ' '..'Z' (if N > 1)
Note that the PASCAL subrange ' '..'Z' restricts characters from being
lowercase.
Numeric ASCII string:
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = 9 or 9+
ELEMENT-LENGTH = N
The corresponding PASCAL data type will be generated:
'0'..'9' (if N = 1) or
PACKED ARRAY[1..N] OF '0'..'9' (if N > 1)
However, you must check that the minus sign doesn't appear in the data.
Zoned decimal:
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = Z
ELEMENT-LENGTH = N
The corresponding PASCAL data type will be generated:
'+'..'}' (if N = 1) or
PACKED ARRAY[1..N] OF '0'..'}' (if N > 1)
The above mapping indicates that the zoned decimal consists of (N - 1)
digits with a trailing overpunch.
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = Z+
ELEMENT-LENGTH = N
The corresponding PASCAL data type will be generated:
'+'..'{' (if N = 1) or
PACKED ARRAY[1..N] OF '0'..'{' (if N > 1)
Logical value (absolute binary):
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = K (or K+)
ELEMENT-LENGTH = 2
The corresponding PASCAL data type will be generated:
SET of 0..15
For any other ELEMENT-LENGTHs, an "Undefined PASCAL type" will be
generated.
Packed decimal:
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = P (or P+)
ELEMENT-LENGTH = N
The corresponding PASCAL data type will be generated:
#0..#255 (if N = 1) or
PACKED ARRAY[1..N] OF #0..#255 (if N > 1)
Boolean:
If the entity is defined in the Dictionary as
ELEMENT-TYPE = B
The corresponding PASCAL data type will be generated:
BOOLEAN
Note that ELEMENT-LENGTH is not needed in this case.
String:
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = S
ELEMENT-LENGTH = N
The corresponding PASCAL data type will be generated:
STRING[N]
Note that the storage length is not the ELEMENT-LENGTH for string data
types.
Integer number:
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = I (or J)
ELEMENT-LENGTH = 2
The corresponding PASCAL data type will be generated:
-32768..32767
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = I (or J)
ELEMENT-LENGTH = 4
The corresponding PASCAL data type will be generated:
INTEGER
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = I+ (or J+)
ELEMENT-LENGTH = 2
The corresponding PASCAL data type will be generated:
0..32767
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = I+ (or J+)
ELEMENT-LENGTH = 4
The corresponding PASCAL data type will be generated:
0..MAXINT
Real number:
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = E (or R)
ELEMENT-LENGTH = 4
The corresponding PASCAL data type will be generated:
REAL
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = E (or R)
ELEMENT-LENGTH = 8
The corresponding PASCAL data type will be generated:
LONGREAL
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = E+ (or R+)
ELEMENT-LENGTH = 4
The corresponding PASCAL data type will be generated:
REAL
If the entity is defined in the Dictionary as:
ELEMENT-TYPE = E+ (or R+)
ELEMENT-LENGTH = 8
The corresponding PASCAL data type will be generated:
LONGREAL
For all other cases:
For an element that back-references another element data type, PASCAL
will map the data type of the back referenced element to a compatible
PASCAL data type.
If the element-length or the byte position is not valid for a REAL,
LOGICAL, or INTEGER data type, DICTPDE will generate the following:
PACKED ARRAY[1..ELEMENT_LENGTH] OF CHAR
A warning is also issued indicating that even though the element length
or byte position is not valid for that data type, a data declaration was
generated for that entity. Please note that these entities should not be
accessed for use in PASCAL programs unless the correct PASCAL can be made
for the data type. (In order to do so, the invalid element length or
byte position should be corrected in the Dictionary.)
MPE/iX 5.0 Documentation