Microsoft KB Archive/50895

From BetaArchive Wiki

COBOL ASSIGN TO DISPLAY Sends Output to the Screen

PSS ID Number: Q50895 Article last modified on 11-17-1989

3.00 3.00a | 3.00 3.00a MS-DOS | OS/2

Summary: The ASSIGN TO DISPLAY clause in a SELECT statement causes output to the file so assigned to be displayed on the screen. This information applies to the Microsoft COBOL Compiler Versions 3.00 and 3.00a for MS-DOS and MS OS/2.

More Information: The following program demonstrates the ASSIGN TO DISPLAY clause: ENVIRONMENT DIVISION. SELECT OUT-file ASSIGN TO DISPLAY ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD OUT-FILE. 01 OUT-REC PIC X(80). PROCEDURE DIVISION. OPEN OUTPUT OUT-FILE. MOVE “Hello there” TO OUT-REC. WRITE OUT-REC. MOVE “Goodbye” TO OUT-REC. WRITE OUT-REC. CLOSE OUT-FILE. STOP RUN. The above program results in the following being displayed on the screen: Hello there Goodbye

Copyright Microsoft Corporation 1989.