HP OpenVMS Systems Documentation |
HP COBOL
|
Previous | Contents | Index |
% cobol -c test.cob % cobol test.o |
The -tps flag allows HP COBOL applications to make use of ACMSxp, the Application Control and Management System/Cross-Platform Edition.
-tps specifies that files are part of a transaction processing system, and enables Encina Structured File System (SFS) record storage for applicable files. It is intended to be used in conjunction with the Transarc Encina external file handler and ACMSxp, allowing access to data in a wide variety of databases, without the need to write code in the language of the databases. This approach provides access to transaction processing technology, and incorporates industry standards for data communications and distributed computing. ACMSxp conforms to the the Multivendor Integration Architecture (MIA).
COBOL is one of the languages approved by MIA for transaction processing (TP) client programs, customer-written presentation procedures, and processing procedures. For database access, Structured Query Language (SQL) is the MIA-required access language. The SQL is embedded in COBOL and C.
Refer to the ACMSxp documentation for full details. Additional
information can also be found in published Distributed Computing
Environment (DCE) documentation.
1.1.2.4 Specifying Multiple Files and Flags
The cobol command can specify multiple file names and multiple flags. Multiple file names are delimited by spaces. If appropriate, each file name can have a different suffix. The file name suffix could result in the following actions:
When a file is not in your current working directory, specify the
directory path before the file name.
1.1.2.5 Compiling Multiple Files
An entire set of source files can be compiled and linked together using a single cobol command:
% cobol -o calc mainprog.cob array_calc.cob calc_aver.cob |
This cobol command:
The files can also be compiled separately, as follows:
% cobol -c array_calc.cob % cobol -c calc_aver.cob % cobol -o calc mainprog.cob array_calc.o calc_aver.o |
In this case, the -c option prevents linking and retains the .o files. The first command creates the file array_calc.o . The second command creates the file calc_aver.o . The last command compiles the main program and links the object files into the executable program named calc .
If your path definition includes the directory containing calc , you can run the program by simply typing its name:
% calc |
You can compile multiple source files by concatenating them:
% cat proga1.cob proga2.cob proga3.cob > com1.cob % cat progb1.cob progb2.cob > com2.cob % cobol -c com1.cob com2.cob |
The resulting file names are com1.o and com2.o. The OpenVMS Alpha and I64 equivalent to this is:
$ COBOL proga1+proga2+proga3,progb1+progb2 |
To debug a program using the Ladebug Debugger, compile the source files with the -g flag to request additional symbol table information for source line debugging in the object and executable program files. The following cobol command also uses the -o flag to name the executable program file calc_debug :
% cobol -g -o calc_debug mainprog.cob array_calc.cob calc_aver.cob |
To debug an executable program named calc_debug, type the following command:
% ladebug calc_debug |
For more information on running the program within the debugger, refer to the Ladebug Debugger Manual.
Pay attention to compiler messages. Informational and warning messages
(as well as error-level messages) do not prevent the production of an
object file, which you can link and execute. However, the messages
sometimes point out otherwise undetected logic errors, and the
structure of the program might not be what you intended.
1.1.2.7 Output Files: Object, Executable, Listing, and Temporary Files
The output produced by the cobol command includes:
If the environment variable TMPDIR is set, the value is used as the directory for temporary files.
You control the production of these files by specifying the appropriate flags on the cobol command line. Unless you specify the -c flag, the compiler generates a single temporary object file, whether you specify one source file or multiple source files separated by blanks. The ld linker is then invoked to link the object file into one executable image file.
The object file is in Tru64 UNIX extended coff format. The object file provides the following information:
If severe errors are encountered during compilation or if you specify certain flags such as -c , linking does not occur.
Previous | Next | Contents | Index |