What's in the COBOL System? [ Micro Focus COBOL for UNIX, Getting Started ] MPE/iX 5.0 Documentation
Micro Focus COBOL for UNIX, Getting Started
What's in the COBOL System?
The most important parts of the COBOL system are:
* The cob command, which you use to invoke all stages of compiling
and linking a COBOL application, including COBOL programs, C
routines, assembler routines, and system libraries.
* The Compiler, which cob uses to check that your program is valid
COBOL and produce intermediate code suitable for execution or
debugging in the Animator.
* Animator, which provides extensive testing and debugging
facilities by allowing you to watch and control the flow of
execution through your source code while your program (in
intermediate code) is running.
* The Native Code Generator (sometimes called the Generator or NCG
for short), which cob uses to produce optimized object code from
your intermediate code. The object code can be output in a
dynamically loadable Micro Focus format, known as generated code,
or in your operating system's standard format for object files
ready for linking.
* The cobrun command, which dynamically loads and runs your
intermediate code or generated code program.
* The run-time support programs and libraries, which contain
routines supporting advanced features of the COBOL language.
The cob command uses the system linker to link together COBOL, C object
files, assembler object files, and any COBOL run-time support routines or
user libraries, to produce an executable application. If, alternatively,
you run your intermediate or generated code, cobrun automatically loads
all support routines needed at run time as necessary.
The optimized object code produced by the Generator is native machine
code, and so runs much faster than intermediate code. However,
intermediate code is generally portable across Micro Focus COBOL systems
on different machines and operating systems.
The COBOL language in this system gives you powerful facilities over and
above those usually found in other COBOL systems. Notably, you can write
programs to make full use of:
* screen displays
* your own file handlers
* mixed language programming
The system accepts COBOL source programs conforming to any of the
following standards and dialects:
* ANSI'74
* ANSI'85
* Micro Focus COBOL
* IBM OS/VS COBOL
* IBM VS COBOL II
* IBM DOS/VS COBOL
* IBM SAA COBOL
* IBM COBOL/370
* IBM COBOL/2
* Microsoft COBOL
* RM/COBOL
* DG Interactive COBOL (v1.3)
* X/Open COBOL
Industry Standards Used by Micro Focus
The Micro Focus COBOL Compiler, Native Code Generator and Run-time System
comply with the following industry standards, and are routinely certified
each year and appear in the Validated Products List of the US Department
of Commerce, National Institute of Standards and Technology.
1. American National Standards Institute (ANSI) - X3.23-1985
(Programming Language COBOL) amended by X3.23a-1989 (Intrinsic
Function module) and X3.23b-1993 (Corrections Amendment)
The following required modules of the high-level ANSI STANDARD
STANDARD are supported:
* Nucleus (2 NUC 1,2)
Provides internal processing of data within the four basic
divisions of a program and the capability for defining and
accessing tables.
* Sequential I-O (2 SEQ 1,2)
Provides access to records of a file in established
sequence. The sequence is established as a result of
writing the records to the file.
* Relative I-O (2 REL 0,2)
Provides access to records in either a random or sequential
manner; each record in a relative file is uniquely
identified by an integer specifying the record's logical
position in a file.
* Indexed I-O (2 INX 0,2)
Provides access to records in either a random or sequential
manner; each record in an indexed file is uniquely
identified by the value of a key within that record.
* Sort-Merge (1 SRT 0,1)
Orders one or more files of records, or combines two or
more identically ordered files of records, according to a
set of user-specified keys.
* Inter-Program Communication (2 IPC 1,2)
Allows a COBOL program to communicate with other programs
through transfers of control and access to common data
items.
* Source Text Manipulation (2 STM 0,2)
Allows the insertion and replacement of source program text
as part of the compilation of the source program. COBOL
libraries contain texts which are available to the compiler
at compile time and which can be treated by the compiler as
part of the source program.
The following optional modules are included:
* Segmentation (2 SEG 0,2)
Refreshes independent segments when required.
* Debug (2 DBG 0,2)
Monitors object program execution through declarative
procedures, special debugging lines, and a special
register, DEBUG-ITEM, which gives specific information
about execution status.
* Report Writer (1 RPW 0,1)
Produces reports by specifying the physical appearance of
the report.
2. ISO 1989-1985 Standard of the International Organization for
Standardization (ISO)
3. Federal Standard COBOL of March 1986 (FIPS PUB 21-2), High Level.
Conforms to FIPS PUB 21-2 COBOL and meets the requirements of
FIRMR 201-9.109
4. Federal Standard COBOL (FIPS PUB 21-3), High Level.
Conforms to FIPS PUB 21-3
5. X/Open CAE Specification, COBOL Language (XPG4).
How You Use the COBOL System
Central to the system is the cob command, which invokes the Compiler,
Generator, and UNIX system linker. You set flags to show which of these
you want. You invoke Animator directly from the command line.
The Compiler checks that your COBOL source program is valid COBOL and
converts it to intermediate code. It can also produce information files
needed by the Animator; this is called compiling for animation.
When you first compile your program you should compile for animation.
Once it compiles with no errors, you execute it using the Animator. This
enables you to watch and control the operation of your program, seen
entirely as COBOL source, and therefore makes testing and debugging very
efficient.
When your program is working correctly you run your intermediate code, or
you can have cob produce generated code, in a file with extension .gnt.
You can input either your source code or your intermediate code to cob;
if you input source code, cob will invoke the Compiler before invoking
the Generator. You can run either the intermediate or generated code.
You do this using the cobrun command, which loads and runs your program
and loads run-time support routines as necessary. This method is called
dynamic loading.
Alternatively you can have cob produce object code, in a file with the
extension .o. The cob command can then invoke the UNIX system linker to
produce an executable file. This is called static linking, and the
executable file produced contains all necessary run-time support. You
run this file by simply entering its name at the operating system prompt.
You can also use dynamic linking, using .so object modules, if your UNIX
system supports this method.
MPE/iX 5.0 Documentation