Operation [ Micro Focus COBOL System Reference, Volume 1 ] MPE/iX 5.0 Documentation
Micro Focus COBOL System Reference, Volume 1
Operation
This section describes how to invoke and test existing preprocessors and
how to write one of your own.
Invoking a Preprocessor
You use the PREPROCESS Compiler directive to invoke a preprocessor. For
details on specifying Compiler directives, see the chapter Compiler.
On DOS and OS/2, the command for invoking a preprocessor is:(DOS and
OS/2)
cobol file-name [directives]
preprocess"preproc" [preproc-params]
On Windows, to invoke a preprocessor, use the command:(Windows)
cobolw file-name [directives]
preprocess"preproc" [preproc-params]
either by setting it up as a program icon in a group or using the Run...
option in the File menu in Program Manager.
If you have created a group under Windows or OS/2, then double click on
the preprocessor icon to invoke the preprocessor.(Windows and OS/2)
On UNIX, the command for invoking a preprocessor is:(UNIX)
cob file-name -C" [directives]
preprocess(preproc) [preproc-params]"
where:
file-name is the name of the source file
preproc is the name of the preprocessor
preproc-params is one or more of the optional preprocessor
parameters described in the section Preprocessor
Parameters.
All directives on the command line following the PREPROCESS directive and
up to the end of the line, or the ENDP directive, are passed to the
preprocessor without examination.
In a similar manner to other Compiler directives, the PREPROCESS
directive can be either placed in a directives file; for example, the
default cobol.dir file or included in a $SET statement within the source
code. It should not be specified in more than one place. If it is in a
$SET statement, it must be the first line in the source file. See the
chapter Compiler for details of directives files and $SET statements.
Invoking Multiple Preprocessors.
Multiple preprocessors are invoked if the main preprocessor specifies a
further preprocessor and so uses a stack method, see the section Multiple
Preprocessors later in this chapter.
On DOS and OS/2, the
command line for invoking several preprocessors is:(DOS and OS/2)
cobol file-name [directives]
preprocess"preproc1" [preproc1-params]
[preprocess"preproc2" [preproc2-params]] ...
On Windows, to invoke several preprocessors, use the command:(Windows)
cobolw file-name [directives]
preprocess"preproc1" [preproc1-params]
[preprocess"preproc2" [preproc2-params]]...
either by setting it up as a program icon in a group or using the Run...
option in the File menu in Program Manager.
If you have created a group under Windows or OS/2, then double click on
the preprocessor icon to invoke the preprocessor.(Windows and OS/2)
On UNIX, the command line for invoking several preprocessors is:(UNIX)
cob file-name -C" preprocess(preproc1) [preproc1-params]
[preprocess(preproc2) [preproc2-params]]..."
where:
file-name is the name of the source file
preproc1 is the name of the preprocessor invoked by the
Compiler
preproc1-params is one or more of the optional preprocessor
parameters for preproc1 described in the section
Preprocessor Parameters
preproc2 is the name of a preprocessor invoked by preproc1
preproc2-params is one or more of the optional preprocessor
parameters for preproc2 described in the section
Preprocessor Parameters.
Testing a Preprocessor
The preprocessor program should be compiled in the same manner as any
other program you wish to animate.
On DOS and OS/2, you compile your preprocessor program with the ANIM
directive set:
cobol preproc anim;
On Windows, to compile your preprocessor program with the ANIM directive
set, use the command:
cobolw preproc anim;
either by setting it up as a program icon in a group or using the Run...
option in the File menu in Program Manager.
On UNIX, you compile your preprocessor program with the +A run-time
switch set:
cob +A preproc
After compiling your preprocessor program for animation, you use Animator
as though you want to animate the Compiler itself. You will not see the
Compiler animated since it is not compiled for animation, but you will
see any programs it calls that have been, such as your preprocessor.
On DOS and OS/2 to animate the Compiler, from the command line enter:
animate check end file-name [directives]
preprocess"preproc" ...
On Windows, to animate the Compiler, use the command line:
animatew check end file-name [directives]
preprocess"preproc"...
either by setting it up as a program icon in a group or using the Run...
option in the File menu in Program Manager.
On UNIX, to animate the Compiler, from the command line enter:
cob file-name [directives]
preprocess(preproc) [preproc-params] ...
where :
file-name is the name of the source code
directives are one or more of the Compiler directives described
in the appendix Directives for Compiler
preproc is the name of the preprocessor
preproc-params is one or more of the optional preprocessor
parameters described in the section Preprocessor
Parameters
MPE/iX 5.0 Documentation