[an error occurred while processing this directive]
HP OpenVMS Systems Documentation |
HP COBOL
|
Previous | Contents | Index |
See Section 1.4 for a discussion of errors that can cause incorrect or undesirable results when you run a program.
See Section 1.5 for a discussion of controlling program execution
with switches.
1.1.5 Program Development Stages and Tools
This manual primarily addresses the program development activities associated with development and testing phases. For information about topics usually considered during application design, specification, and maintenance, refer to your operating system documentation, appropriate reference pages, or appropriate commercially published documentation.
Table 1-3 lists and describes some of the software tools you can use when developing and testing a program.
Task or Activity | Tool and Description |
---|---|
Manage source files | Use RCS or sccs to manage source files. For more information, refer to the Tru64 UNIX documentation on programming support tools or the appropriate reference page. |
Create and modify source files | Use a text editor, such as vi , emacs , or another editor. For more information, refer to your operating system documentation. |
Analyze source code | Use searching commands such as grep and diff . For more information, refer to the Tru64 UNIX documentation on programming support tools or the appropriate reference page. |
Build program (compile and link) | You can use the cobol command to create small programs, perhaps using shell scripts, or use the make command to build your application in an automated fashion using a makefile. For more information on make , refer to the make(1) reference page and the Tru64 UNIX documentation on programming support tools. |
Debug and test program | Use the Ladebug Debugger to debug your program or run it for general testing. For more information on Ladebug Debugger, refer to the Ladebug Debugger Manual. |
Install program | Use setld and related commands such as tar . For more information, refer to the Tru64 UNIX documentation on programming support tools. |
In addition, you might use the following shell commands at various times during program development:
The CALL dataname, CANCEL, and the Hewlett-Packard extensions to the ACCEPT and DISPLAY statements will not work correctly if you use the strip command on your image. |
In most instances, use the cobol command to invoke both the HP COBOL compiler and the ld linker. To link one or more object files created by the HP COBOL compiler, you should use the cobol command instead of the ld command, because the cobol command automatically references the appropriate HP COBOL Run-Time Libraries when it invokes ld . If the executable image is not in your current working directory, specify the directory path in addition to the file name.
Compilation does the following for you:
You use the cobol command to compile and link your program. The cobol command invokes the HP COBOL compiler driver that is the actual user interface to the HP COBOL compiler. The compiler driver can accept command options and multiple file names, and normally causes the compiler and linker to process each file. A variety of qualifiers to the compile command are available to specify optional processing and to specify the names of output files.
After the HP COBOL compiler processes the source files to create
one or more object files, the compiler driver passes a list of object
files and other information to the linker. <>
1.2 Developing Programs on OpenVMS
You use DCL commands (commands used at the OpenVMS system prompt)
to create, compile, link, and run HP COBOL programs on
OpenVMS systems.
1.2.1 Creating an HP COBOL Program on OpenVMS
To create and modify an HP COBOL program, you must invoke a text editor. The default editor for OpenVMS is the Text Processing Utility (TPU). Other editors, such as EDT or the Language-Sensitive Editor (LSE), may be available on your system. Check with your system administrator and refer to the OpenVMS EDT Reference Manual (this manual has been archived but is available on the OpenVMS Documentation CD-ROM) for more information about EDT or the Guide to Language-Sensitive Editor for additional information about LSE.
Figure 1-2 shows the basic steps in HP COBOL program development.
Figure 1-2 DCL Commands for Developing Programs
Use the text editor of your preference to create and revise your source files. For example, the following command line invokes the TPU editor and creates the source file PROG_1.COB:
$ EDIT PROG_1.COB |
The file type .COB is used to indicate that you are creating an HP COBOL program. COB is the default file type for all HP COBOL programs.
The COPY Statement, Dictionaries, and Libraries
Including the COPY statement in your program allows separate programs to share common source text, reducing development and testing time as well as storage requirements. You can use the COPY statement to access modules in libraries. The COPY statement causes the compiler to read the file or module specified during the compilation of a program. When the compiler reaches the end of the included text, it resumes reading from the previous input file.
By using the /INCLUDE qualifier on the COBOL command line, you can set up a search list for files specified by the COPY statement. For more information, refer to the HP COBOL Reference Manual.
You can use the COPY FROM DICTIONARY statement in your program to access a data dictionary and copy Oracle CDD/Repository record descriptions into your program as COBOL record descriptions. Before you can copy record descriptions from Oracle CDD/Repository, you must create the record descriptions using the Common Data Dictionary Language (CDDL) or Common Dictionary Operator (CDO).
Previous | Next | Contents | Index |