Created On: 19 March 2010
Problem:
Server Express 2.2 has a different behavior than Server Express 5.1 WS4.
A difference identified regards ACCEPT behavior which can be seen in the following code:
ACCEPT ST-BANK-AMOUNT AT LINE 07 COLUMN 15
WITH AUTO UNDERLINE HIGHLIGHT UPDATE
ON EXCEPTION
DISPLAY "ERROR BANK AMOUNT" AT 2302
ACCEPT DUMMY AT 2379 SECURE
GO TO ACCEPT-ST-BANK-AMOUNT
NOT ON EXCEPTION
PERFORM ACCEPT-ST-BANK-DESCR.
Although it runs fine under SCO it always goes to the ON EXCEPTION phrase when it runs on Linux.
When you delete the UPDATE clause from ACCEPT then the value is accepted correctly and the code goes to the NOT ON EXCEPTION paragraph. It was also noticed that when compiling the application with the RM compiler directive, the UPDATE clause does not cause exception.
A difference identified regards ACCEPT behavior which can be seen in the following code:
ACCEPT ST-BANK-AMOUNT AT LINE 07 COLUMN 15
WITH AUTO UNDERLINE HIGHLIGHT UPDATE
ON EXCEPTION
DISPLAY "ERROR BANK AMOUNT" AT 2302
ACCEPT DUMMY AT 2379 SECURE
GO TO ACCEPT-ST-BANK-AMOUNT
NOT ON EXCEPTION
PERFORM ACCEPT-ST-BANK-DESCR.
Although it runs fine under SCO it always goes to the ON EXCEPTION phrase when it runs on Linux.
When you delete the UPDATE clause from ACCEPT then the value is accepted correctly and the code goes to the NOT ON EXCEPTION paragraph. It was also noticed that when compiling the application with the RM compiler directive, the UPDATE clause does not cause exception.
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 statment, 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 statment, 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# 31282