![]() ![]() So: 01 FIELD-NAME PIC X(02) COMP-5 VALUE 12345 can not be translated to 01 FIELD-NAME PIC 9(04) COMP-5 VALUE 12345. If you use a value-clause, there is no warning but an error, and no object is generated. If you move 12345 to such a field, you get a compiler warning (numeric overflow), but in spite of the warning, the execution goes right. The behaviour of those fields is exactly like the PIC X(02) COMP-5, but only if you use the BINARY(BYTE) compiler option. In Fujitsu, you must declare them as 9(04) COMP-5. These fields are very important if you call the Windows API's or C(++) routines directly from Cobol. If you declare a field like PIC X(02) COMP-5, you have a two-byte field which can hold any unsigned number which fits into two bytes, so 0. In Net Express, you can have alphanumeric comp-5 fields, eg PIC X(02) COMP-5. I must strongly advise you to use this option in Fujitsu. Fortunately, Fujitsu knows the BINARY(BYTE) compiler option, which changes this Fujitsu behaviour to the same as Net Express. FUJITSU stores COMP and COMP-5 fields in 2, 4 or 8 bytes depending on the picture clause. My experience is, Fujitsu is more strictly using ANSI standards than Net Express does. I could write the entire evening about the differences, I think you must ask some specific questions in this forum. In fact, our sources compile and run both in Net Express and Fujitsu Cobol now.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |