Microsoft KB Archive/40036
ACCEPT WITH UPDATE Lets Default Not Erase COBOL Data Element
PSS ID Number: Q40036 Article last modified on 04-20-1993
3.00 3.00a | 3.00 3.00a MS-DOS | OS/2
|The information in this article applies to:|
|- Microsoft COBOL for MS-DOS and OS/2, versions 3.0 and 3.0a|
Summary: The default method for ACCEPTing a single-data element in Microsoft COBOL Versions 3.0 and 3.0a is to erase any value that the element had before the ACCEPT, then let you enter a new value. This method is not always desirable because you might want to set up a default value and let the user modify this value.
More Information: One of the methods to alter the default action of the ACCEPT statement is to use the WITH UPDATE clause. The WITH UPDATE clause causes the value of the data element to be preserved, allowing you to modify the value. An example of this is demonstrated with the following: WORKING-STORAGE SECTION. 77 TEST-FIELD PIC X(20) VALUE SPACES. PROCEDURE DIVISION. MOVE “THIS IS MODIFIABLE” TO TEST-FIELD. ACCEPT TEST-FIELD WITH UPDATE. STOP RUN.
Additional reference words: 3.00 3.00a Copyright Microsoft Corporation 1993.