Created On: 19 March 2010
Problem:
After upgrading from Server Express 2.2 to Server Express 5.1 WS4 it was noticed that there are some differences in behavior among the two systems in terms of the DISPLAY command behavior.
For example:
01 DISP-LINE-1.
05 FILLER PIC X(01) VALUE SPACES.
05 FILLER PIC X(10) VALUE "ABCDEFGHIJ".
05 FILLER PIC X(05) VALUE SPACES.
05 FLD-0011 PIC X(02) value "AA"
If the program contains the following statement:
DISPLAY DISP-LINE-1 AT 0501 WITH REVERSED.
Then although the variables are displayed in reverse, the filler fields continue to be black. If you change the filler fields to variables that include spaces, then the whole line is printed in reverse. This was not the behavior with the old version 2.2 where even filler fields where displaying in reverse.
It was also noticed that when adding the RM compiler directive the behavior is corrected and Filler fields are presented correctly.
For example:
01 DISP-LINE-1.
05 FILLER PIC X(01) VALUE SPACES.
05 FILLER PIC X(10) VALUE "ABCDEFGHIJ".
05 FILLER PIC X(05) VALUE SPACES.
05 FLD-0011 PIC X(02) value "AA"
If the program contains the following statement:
DISPLAY DISP-LINE-1 AT 0501 WITH REVERSED.
Then although the variables are displayed in reverse, the filler fields continue to be black. If you change the filler fields to variables that include spaces, then the whole line is printed in reverse. This was not the behavior with the old version 2.2 where even filler fields where displaying in reverse.
It was also noticed that when adding the RM compiler directive the behavior is corrected and Filler fields are presented correctly.
Resolution:
The RM (Ryan McFarland language compatibility) directive sets MODE IS BLOCK by default. For example, if the RM directive is used, the DISPLAY statement behaves as if MODE IS BLOCK had been coded, whether or not it is actually present.
If the MODE IS BLOCK phrase is used in the DISPLAY statement, filler item values are displayed. Absent MODE IS BLOCK, filler items affect screen positioning of subsequent items, but their own values are not displayed.
The MODE IS BLOCK Clause
If the MODE IS BLOCK clause is added to an ACCEPT or DISPLAY of a group item, the group item is treated as if it was an elementary item of the total size of the group item.
Consider the following group item:
01 display-item.
03 display-item-1 pic x(20).
03 filler pic x(35).
03 display-item-2 pic 9(10).
03 filler pic x(105).
03 display-item-3 pic z(4)9.
If the following statement is executed:
display display-item at 0101 mode is block.
display-item is treated as if it is an elementary item defined as:
01 display-item pic x(175).
Consequently, the contents of the FILLER items are also displayed.
Note: If a program is compiled with the IBM-MS, MS"1", MS"2" or RM directives set, the Compiler treats all DISPLAY and ACCEPT operations of group items as if MODE IS BLOCK had been specified.
If the MODE IS BLOCK phrase is used in the DISPLAY statement, filler item values are displayed. Absent MODE IS BLOCK, filler items affect screen positioning of subsequent items, but their own values are not displayed.
The MODE IS BLOCK Clause
If the MODE IS BLOCK clause is added to an ACCEPT or DISPLAY of a group item, the group item is treated as if it was an elementary item of the total size of the group item.
Consider the following group item:
01 display-item.
03 display-item-1 pic x(20).
03 filler pic x(35).
03 display-item-2 pic 9(10).
03 filler pic x(105).
03 display-item-3 pic z(4)9.
If the following statement is executed:
display display-item at 0101 mode is block.
display-item is treated as if it is an elementary item defined as:
01 display-item pic x(175).
Consequently, the contents of the FILLER items are also displayed.
Note: If a program is compiled with the IBM-MS, MS"1", MS"2" or RM directives set, the Compiler treats all DISPLAY and ACCEPT operations of group items as if MODE IS BLOCK had been specified.
Old KB# 31281