Microsoft KB Archive/40874

UNSTRING Does Not Work with DATA DIVISION Greater Than 64K

PSS ID Number: Q40874 Article last modified on 04-20-1993

3.00 | 3.00 MS-DOS | OS/2

Summary: The UNSTRING statement does not perform correctly in Version 3.0 of Microsoft COBOL when the data division of the program is larger than 64K. Reducing the size of the data division to below 64K causes the UNSTRING statement to operate correctly. Microsoft has confirmed this to be a problem in Version 3.0. This problem was corrected in Version 3.0a.

More Information: The example program below demonstrates the problem COBOL Version 3.0 has with the UNSTRING statement when the data division is greater than 64K: The compile step: COBOL example.cbl; The LINK step: LINK example.obj; The following is the example program: $SET ANS85 NOSMALLDD MODEL“HUGE” WORKING-STORAGE SECTION. 01 UNSTRING-DATA PIC X(50) VALUE SPACES. 01 UNSTRING-WORD1 PIC X(50) VALUE SPACES. 01 UNSTRING-WORD2 PIC X(50) VALUE SPACES. 01 UNSTRING-WORD3 PIC X(50) VALUE SPACES. 01 W-OVERFLOW PIC X(150) OCCURS 400. 01 W-EXTRA-DATA PIC X(150) OCCURS 32. PROCEDURE DIVISION. PROG. DISPLAY &quot; “. DISPLAY”INPUT 3 WORDS (blank separated) and ENTER :“. ACCEPT UNSTRING-DATA. DISPLAY”read WORD(1) : &quot; UNSTRING-WORD1. DISPLAY “read WORD(2) :” UNSTRING-WORD2. DISPLAY “read WORD(3) :” UNSTRING-WORD3. UNSTRING UNSTRING-DATA DELIMITED BY &quot; &quot; INTO UNSTRING-WORD1 UNSTRING-WORD2 UNSTRING-WORD3. STOP RUN.

Additional reference words: 3.00 Copyright Microsoft Corporation 1993.