COBOL - compile/load/ranedit Cobol 74 program.

Syntax:

cobol filename [filename]* [option]*
(+|-)Clear (-)           Gstar=filename
Hstar=filename (.h)      Library=filename
(+|-)Listing (-)         (+|-)Map (-)
Memory=nn (32)           Name=name
Object=filename          Test=filename
UpdateLib=filename       USe=name
(+|-)Zdebug (-)

Examples:

cobol cobprog
cobol cobsub u=tlib +c
cobol cobprog l=tlib +map

Options:

filename
is taken as the name of a Cobol 74 source file, if the file is sequential. For details on the file format, see below. If more than one source file is given, they will be compiled together as one program. If "filename" is a random file, it is taken as a random library; thus it is treated as if you had said "Library=filename".
+Clear
is used in conjunction with the "UpdateLib=" option to force the initialization of the library. You must use the option if the library has never been initialized.
Gstar=filename
preserves the intermediate file containing GMAP assembly code in the file "filename".
Hstar=filename
specifies where the loader is to place the core image file it generates. If this option is not given, a file name of ".h" is used.
Library=filename
adds the random or sequential library in "filename" to the list of libraries. Such libraries will be searched by the loader in the order given.
+Listing
tells the compiler to generate a program listing.
+Map
tells the loader to generate a load map.
Memory=nn
sets the initial memory size for the compiler to "nn" K words.
Name=name
gives the core image generated by the loader the name "name", instead of the default name of "object".
Object=filename
tells the compiler to generate an object deck and place it in "filename".
Test=filename
uses the Cobol compiler core image in file "filename" instead of the normal system version.
UpdateLib=filename
calls Ranedit to edit the object deck produced by the compilation into the random library "filename". If the loader is called, this library will also be searched by the loader.
USe=name
forces the routine called "name" to be searched for by the loader.
+Zdebug
tells the Cobol command to perform debugging functions. At the time of writing, "+Zdebug" has the effect of leaving all files prepared for the compilation in the AFT when the command returns.

Description:

The COBOL command provides you with a means of preparing Cobol 74 programs to run in TSS. The actual compilation is performed in batch by means of a DRL TASK. You can expect the compilation to take somewhat longer than the compilation of a Fortran program of equivalent size.

As a simple example, suppose "file1" contains Cobol source statements. To prepare the program for execution, you just say

cobol file1

To run the program, you use the GO command as in

go

Input format:

COBOL will accept line-numbered programs. These line-numbers will be printed in error messages and on the compiler report (first file of the p*) if the +Listing option is in effect. The generated line-numbers will always be printed.

The rule for determining if a file is line-numbered is as follows: if the first character of the first line is a digit, the file is assumed to be line numbered.

Loader considerations:

The COBOL command makes certain assumptions about whether or not it needs to call the loader. Normally, it will call the loader to prepare a core image. If you specify an option that indicates you probably do not want the loader (e.g. "Object=" or "UpdateLib="), COBOL will not call the loader unless you also specify an option that pertains directly to the loader (such as "+Map", "USe=", or "Hstar=").

If you use the "UpdateLib=" option and also force the loader to be called, the Ranedit will be done after the load as a separate step.

The listing file:

The compiler listing and loader reports are written to a file called "p*". This is left in the AFT when the COBOL command returns.

Normally, you need not concern yourself with the contents of "p*", since COBOL will look at that file for you and print any error messages. However, if you do want to look at the reports, there are special procedures for doing so.

"p*" is a multi-file file. The first file is the compiler report. The second file contains the loader report or nothing, depending on what command options you used.

To inspect the first file is easy; just use the L or P command. To inspect the second file in order to look at the load map report, you should use the L or P command with the option "Fileskip=1".

See Also:

expl cobol tss - how to use Cobol I/O in TSS.

Files Used:

compiler: b*, c*, *1, *2, *3, 5*, s*, g*, d*, p* loader: b*, *l, l*, r*, p*

Copyright © 1996, Thinkage Ltd.