Microsoft KB Archive/59469

COBOL CALL X“91” Function 58 Requires 1 Space After Filename

PSS ID Number: Q59469 Article last modified on 03-09-1990

3.00 3.00a MS-DOS

Summary: When using the special function CALL X“91” with FUNCTION 58, the old and new filename arguments must have exactly one trailing space; otherwise, an error 001 will be returned, which indicates an unsuccessful CALL. Also, the length parameters for the old and new filename arguments must equal the exact length of the respective filename (including the one trailing space), or else error 001 will be returned. If zero or two or more trailing spaces are in the VALUE clause for an old or new filename, the CALL will return with an error code of 001. This information applies to Microsoft COBOL Compiler Versions 3.00 and 3.00a for MS-DOS.

More Information: The following phrases for function 58 on Page 8-14 of the “Microsoft COBOL Compiler 3.0: Operating Guide” are incorrect: – old filename PIC X(n1) containing at least one trailing space – new filename PIC X(n2) containing at least one trailing space These phrases should be changed to read as follows: – old filename PIC X(n1) must contain exactly one trailing space – new filename PIC X(n2) must contain exactly one trailing space In addition, Page 8-14 should mention that the length PIC 99 COMP-X values n1 and n2 must specify the exact length of the old and new filename fields, or else an error code of 001 will be returned.

CALLX.CBL Code Example
The following code, CALLX.CBL, illustrates this requirement. Compile and link as follows: COBOL CALLX.CBL ; LINK CALLX ; The following program runs successfully with a return code of 000. Change the PICTURE clause of old-name and new-name to PIC X(20), as shown in the commented ('') lines. Compile, link, and run it again, and the return code will be error 001. (This assumes you have a file named C:.ABC). IDENTIFICATION DIVISION. PROGRAM-ID. CALLX. ENVIRONMENT DIVISION. CONFIGURATION SECTION. INPUT-OUTPUT SECTION. DATA DIVISION. WORKING-STORAGE SECTION. 01 result pic 99 comp-x value zero. 01 function pic 99 comp-x value 58. 01 parameter. 03 old-length pic 99 comp-x value 15. '' 03 old-name pic x(20) value “c:.abc”. 03 old-name pic x(15) value “c:.abc”. 03 new-length pic 99 comp-x value 15. * 03 new-name pic x(20) value “c:.123”. 03 new-name pic x(15) value “c:.123”. PROCEDURE DIVISION. call x“91” using result, function, parameter. exhibit named result, function, parameter. display result. STOP RUN.

Copyright Microsoft Corporation 1990.