Microsoft KB Archive/32430

Description of MODE IS BLOCK Clause

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

3.00 MS-DOS

Summary: If the MODE IS BLOCK clause is added to an ACCEPT or DISPLAY of a group item, the group item will be treated as if it were an elementary item of the total size of the group item.

More Information: For example, if the following statement is executed DISPLAY Display-Item AT 0101 MODE IS BLOCK where Display-Item is defined as the following, 01 Display-Item. 03 Display-Item-1 PIC X(20). 03 FILLER PIC X(60). 03 Display-Item-2 PIC 9(10). 03 FILLER PIC X(70). 03 Display-Item-3 PIC Z(4)9. Display-Item will be treated as if it were defined as the following: 01 Display-Item PIC X(165). Similarly, if a data-item is defined as follows 01 Data-Item. 03 Data-Char PIC X OCCURS 2000. and the following statement is executed, DISPLAY Data-Item AT 0101. Data-Item will be treated as a DISPLAY of 2000 fields, each defined as PIC X, which is unlikely to be what you require. To avoid this problem, either redefine Data-Item as PIC X(2000) and display that, or use the MODE IS BLOCK clause as follows: DISPLAY Data-Item AT 0101 MODE IS BLOCK. Please note that if a program is compiled with the IBM-MS, MS(1), MS(2) or RM directives, the compiler will treat all DISPLAYs and ACCEPTs of group items as if MODE IS BLOCK had been specified.

Additional reference words: 3.00 Copyright Microsoft Corporation 1993.