Compiling, Linking, and Executing Programs [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation
HP COBOL II/XL Reference Manual
Compiling, Linking, and Executing Programs
To make your HP COBOL II source program a valid MPE XL program file, you
must compile, link, and execute it. There are two ways to perform these
tasks:
* With command files.
* With the RUN command and the Link Editor.
This section describes compilation, linking, and execution and explains
the different ways of performing them.
Overview
The HP COBOL II compiler compiles the source program, which is created in
a text file. The compiler translates the source code into binary form
and stores it in an object file.
The MPE XL Link Editor links the object file into a program file by
binding the procedures in the object files together and defining the
initial requirements of the user data space.
The MPE XL operating system allocates the space for the program, binds
its external procedures to it, and runs it. (The external procedures are
in executable libraries.)
Figure H-2 shows how a source program becomes an executing program.
Figure H-2. How a Source Program Becomes an Executing Program
Command Files
Table H-2 lists the MPE XL system-wide command files that you can use
to compile, link, and execute HP COBOL II programs. You can enter these
commands as part of the input stream in job or batch mode or from your
terminal in a session.
The first three command files invoke the HP COBOL II compiler through the
entry point that conforms to the 1985 ANSI COBOL standard. The next
three command files invoke the HP COBOL II compiler through the entry
point that conforms to the 1974 ANSI COBOL standard. You can look at
these command files by using the MPE XL PRINT command. For example, to
display the COB85XL command file, enter PRINT COB85XL.PUB.SYS. Refer to
the Link Editor/XL Reference Manual for information on how to link object
files.
Table H-2. Command Files
--------------------------------------------------------------------------------------------
| | |
| Command | Description |
| | |
--------------------------------------------------------------------------------------------
| | |
| COB85XL | Invokes the COBOL compiler using the 1985 ANSI standard entry point and |
| | creates an object file. |
| | |
--------------------------------------------------------------------------------------------
| | |
| COB85XLK | Invokes the COBOL compiler using the 1985 ANSI standard entry point, |
| | links the object file, and creates a program file. |
| | |
--------------------------------------------------------------------------------------------
| | |
| COB85XLG | Invokes the COBOL compiler using the 1985 ANSI standard entry point, and |
| | creates and runs a program file in $NEWPASS. |
| | |
--------------------------------------------------------------------------------------------
| | |
| COB74XL | Invokes the COBOL compiler using the 1974 ANSI standard entry point and |
| | creates an object file. |
| | |
--------------------------------------------------------------------------------------------
| | |
| COB74XLK | Invokes the COBOL compiler using the 1974 ANSI standard entry point, |
| | links the object file, and creates a program file. |
| | |
--------------------------------------------------------------------------------------------
| | |
| COB74XLG | Invokes the COBOL compiler using the 1974 ANSI standard entry point, and |
| | creates and runs a program file in $NEWPASS. |
| | |
--------------------------------------------------------------------------------------------
Syntax. [REV BEG]
COB85XL [textfile][,[objectfile][,[listfile][,[masterfile] [,newfile]]]]
[;INFO="info"][;WKSP=workspacename] [;XDB=xdbfile]
COB85XLK [textfile][,[progfile][,[listfile][,[masterfile] [,newfile]]]]
[;INFO="info"][;WKSP=workspacename] [;XDB=xdbfile]
COB85XLG [textfile][,[listfile][,[masterfile][,newfile]]]
[;INFO="info"][;WKSP=workspacename] [;XDB=xdbfile]
COB74XL [textfile][,[objectfile][,[listfile][,[masterfile] [,newfile]]]]
[;INFO="info"][;WKSP=workspacename] [;XDB=xdbfile]
COB74XLK [textfile][,[progfile][,[listfile][,[masterfile] [,newfile]]]]
[;INFO="info"][;WKSP=workspacename] [;XDB=xdbfile]
COB74XLG [textfile][,[listfile][,[masterfile][,newfile]]]
[;INFO="info"][;WKSP=workspacename] [;XDB=xdbfile]
[REV END]
Parameters.
textfile MPE or TSAM file containing your source program. This
file can be compiled. The default is $STDIN.
objectfile Relocatable object code file. This file can be linked.
The default is $NEWPASS or $OLDPASS. The object file
code can be NMOBJ or NMRL. The compiler will take the
appropriate actions for existing files. Refer to RLINIT
or RLFILE in the section on "Control Options" for new
files.
progfile Executable program file. This file can be executed.
The default is $NEWPASS.
listfile File on which your source code will be listed. The
default is $STDLIST.
masterfile MPE or TSAM file to be merged with textfile to produce a
composite source program. If masterfile is omitted, the
entire source is from textfile.
newfile MPE file into which the merged textfile and masterfile
is written. For details, refer to the HP COBOL II
Reference Manual. If newfile is omitted, no new file is
written.
info A string whose value is a command list of the form:
"$compiler_command[$compiler_command]..."
where no compiler_command contains the character $.
If the number of commands is long enough, you can use an
ampersand (&) to continue the info string. The length
limit for a compiler command is the same as the length
limit for a source program line.
In the listing file, the string "INFO=" appears where
the sequence numbers normally appear.
The info string is processed before any source,
including compiler commands in the source. Therefore,
you may not want to use the default settings of these
commands in the source file. You should only include
commands such as SUBPROGRAM, which are required for
proper compilation, in the source file. This allows you
to specify commands like NOLIST, MAP, BOUNDS, or
CROSSREF uniquely within the info string for each
compilation.
workspacename Work space in which HP TOOLSET/XL can manage versions of
the source program.[REV BEG]
xdbfile MPE XL file into which a listing of the source code is
written. xdbfile is used to view the source code in the
HP Symbolic Debugger/XL.[REV END]
MPE/iX 5.0 Documentation