Microsoft KB Archive/43310: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (X010 moved page Microsoft KB Archive/Q43310 to Microsoft KB Archive/43310 without leaving a redirect: Text replacement - "Microsoft KB Archive/Q" to "Microsoft KB Archive/")
 
(No difference)

Latest revision as of 18:23, 12 August 2020

File Status Example Uses the Wrong Format for MS(2)

PSS ID Number: Q43310 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 program example on Page 7-20 of the “Microsoft COBOL Compiler Version 3.0: Operating Guide” displays the file status in the wrong format when compiled with the MS(2) directive. The correct format is displayed (“9 nnnn”, where nnnn is error code) when the COMP picture is changed to COMP-0 as shown below.

More information: Two workarounds for this behavior are as follows: 1. Compile without the MS(2) directive. 2. Change the COMP picture to COMP-0 as shown below. Code Example $SET MS(2) ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT FILE1 ASSIGN “A:TST.FIL” STATUS FILE1-STAT. DATA DIVISION. FILE SECTION. FD FILE1. 01 F1-REC PIC X(80). WORKING-STORAGE SECTION. 01 FILE1-STAT. 02 S1 PIC X. 02 S2 PIC X. 01 STAT-BIN REDEFINES FILE1-STAT PIC 9(4) COMP. * ^^^^ * This needs to be COMP-0 for MS(2) 01 DISPLY-STAT. 02 S1-DISPL PIC X. 02 FILLER PIC X(3). 02 S2-DISPL PIC 9999 USAGE DISPLAY. PROCEDURE DIVISION. START-TEST. OPEN INPUT FILE1. IF S1 NOT = “9” GO TO END-TEST. MOVE S1 TO S1-DISPL. MOVE LOW-VALUES TO S1. MOVE STAT-BIN TO S2-DISPL. DISPLAY DISPLY-STAT. END-TEST. STOP RUN.

Additional reference words: 3.00 3.00a Copyright Microsoft Corporation 1993.