4.1 Mapping the Dialog Data Types on COBOL Data Types
4.1.1 Basic Data Types
The basic data types used in the dialog are mapped in COBOL as follows:
DM Data Type |
COBOL Data Type |
---|---|
boolean |
pic 9(4) binary |
cardinal |
pic 9(4) binary |
enum |
pic 9(4) binary |
datatype |
pic 9(4) binary |
index |
no equivalent |
object |
pic 9(9) binary |
string [?] |
pic X(?) COBOL Interface for Micro Focus Visual COBOL: pic N(?) national |
integer |
pic 9(9) binary |
attribute |
pic 9(9) binary |
method |
pic 9(9) binary |
class |
pic XX |
anyvalue |
no equivalent COBOL Interface for Micro Focus Visual COBOL: pointer |
4.1.2 Records
Besides these basic data types even the records are converted to COBOL data types. The conversion is done according to the pattern above for each element individually.
The definitions necessary for the COBOL program are made available by a generated COBOL copy file. This generation is done by means of the simulation program and the start option +/-writetrampolin.
idm +writetrampolin <base-name> <dialog-file-name>
Example
A record shall contain a string and a number.
record Test1 { string[25] Value1; integer Value3; }
The accordingly generated COBOL definition then looks as follows:
01 Test1 05 Value1 pic X(25). 05 Value3 pic 9(9) binary.
Note
In order to support the data type National Character with Micro Focus Visual COBOL, the option -mfviscob-u must be specified in addition. The COBOL definition then looks like this:
01 RecTest1. 05 Value1-S. 06 Value1 pic X(25). 06 filler pic X(25). 05 filler redfines Value1-S. 06 Value1-u pic N(25) national. 05 Value3 pic S9(9) binary.
4.1.3 Collection Data Types
The colection data types of the IDM and the related functions for (managed) IDM values (Managed DM-Values) are supported through the pointer data type (POINTER) of Micro Focus Visual COBOL.
DM Data Type |
Visual COBOL Data Type |
---|---|
POINTER |
|
POINTER |
|
POINTER |
|
POINTER |
|
POINTER |
A Managed DM-Value is passed as pointer to Micro Focus Visual COBOL:
01 ManagedValue pointer. ENTRY "GetAnyValue" using DM-COMMON-DATA ManagedValue.
To use such a value within the DM-Value structure, the value is copied to DM-value-pointer and DM-datatype is set to DT-anyvalue.
MOVE DT-anyvalue TO DM-datatype. MOVE ManagedValue To DM-value-pointer.
Availability
COBOL Interface for Micro Focus Visual COBOL only.