Problem:
In COBOL, integers are declared as PIC 9 but also have a length descriptor which specifies the amount of data which can be held within ; for example, PIC 9(10).
Resolution:
In a .NET environment, however, there are two types of basic integers; INT16 and INT32. Both of these integers represent an integer of different length; INT16 is a 16-bit signed integer whilsts INT32 is a 32-bit signed integer. In COBOL these two types of integer are represented as:
PIC S9(04) COMP-5 and PIC S9(09) COMP-5 rescpectively.
A PIC X in COBOL is converted into a string data format in the .NET environment. The .NET compiler inserts an automatic conversion beween the COBOL variables and the strings. However, it is worth noting that when defining a string in .NET, the default length of the string is 8192 bytes. Although the developer may in fact require a string which is ten characters in length. So problems may arise when defining the format as a string : for example, if the definition of the string returns COBOL PIC X(10) to the data item and there are other items of data beyond the tenth character, these latter items of data will be lost through truncation. To this end it is importmant to remember that problems of this kind may be encountered when mixing two different kinds of data.
