Microsoft KB Archive/31580

How to use the LINK /ST: Option in COBOL 2.10 or 2.20

PSS ID Number: Q31580 Article last modified on 11-16-1992

2.10 2.20 MS-DOS

Summary: The following article can also be obtained as an application note from Microsoft Product Support Services by calling (206) 454-2030. The application note entitled “Using the /ST: Switch” provides a step-by-step method of increasing the run-time stack-size allocation for COBOL Version 2.10 and Version 2.20 programs. This application note is shown below in its entirety.

More Information: The information below provides a step-by-step method of increasing the run-time stack-size allocation. The key element in increasing stack space is creating a new run-time module that allocates more memory workspace for the stack. To create a new run-time module, type the following at the DOS prompt: link /st:3072 cobol,xxx,,cobol1 cobol2/NOD The following is an explanation of this command and its parts: 1. LINK – The linker or link-editor program, known as LINK in DOS, performs two main tasks: It combines separate object modules (as needed), making all the necessary connections between them, and it converts the modules from object code format to a loadable program in the .EXE format. 2. /ST:size – The /STACK option sets the program stack to the number of bytes given by size. The linker usually calculates a program’s stack size automatically, basing the size on the size of any stack segments given in the object files. If /STACK is given, the linker uses the given size in place of any value it may have calculated. The size can be any positive integer value ranging from 1 to 65535. It may be necessary to increase this number above the recommended 3072 bytes. When increasing this number, you should increase in small, (64-128 byte) increments. 3. COBOL – The COBOL.OBJ file is a required element in building a new, fully functional run-time module. 4. XXX – The user-selected name for the run-time executable module to be produced by the linker. This module’s name will be specified at run-time rather than RUNCOB. 5. COBOL1 and COBOL2 – These .LIBrary files are required elements in building a new, fully functional run-time module. 6. /NOD – This switch requests that the linker make no assumptions, (NO-Default), with regard to .LIB files required to build the run-time module. More information on the LINK utility can be found in your DOS manual. Secondly, it is important to extend run-time screen capabilities to the new run-time executor, as follows: 1. INSTALL the module. 2. At the DOS prompt, type the following: install xxx.exe Finally, invoke the COBOL application with the new run-time module by typing the following: xxx COBOLfilename (Portions of this text were taken from “The Peter Norton Programmer’s Guide to the IBM PC” by Peter Norton, Microsoft Press, 1985.)

Copyright Microsoft Corporation 1992.