Microsoft KB Archive/32431

Numeric-Edited to SCREEN SECTION Numeric-Edited MOVE Illegal

PSS ID Number: Q32431 Article last modified on 04-21-1993

3.00 | 3.00 MS-DOS | OS/2

Summary: In Microsoft COBOL Version 3.0, a field should not be defined as numeric-edited in both the WORKING-STORAGE SECTION and in the SCREEN SECTION. Defining fields as numeric-edited will cause the compiler to move the WORKING-STORAGE item into the SCREEN SECTION work area and back again. The action of such moves is undefined and will have unpredictable results. This error occurs even if both the WORKING-STORAGE item and the SCREEN SECTION item have the same picture, as in the following example: WORKING-STORAGE SECTION. 01 WS-Item PIC ZZ9.99 VALUE 1.23. SCREEN SECTION. 01 Demo-Screen. 03 PIC ZZ9.99 USING WS-Item. PROCEDURE DIVISION. DISPLAY Demo-Screen. The result of the DISPLAY is undefined. The items used in WORKING-STORAGE as source or target for SCREEN SECTION ACCEPTs and DISPLAYs should always be nonedited fields. Microsoft COBOL Version 2.2 allows such moves; however, Version 3.0 does not.

Additional reference words: 3.00 Copyright Microsoft Corporation 1993.