📄 ch4_comp.htm
字号:
<pre><code>$ SHLIB_PATH=${SHLIB_PATH}</code>:$COBDIR/coblib
$ export<code> SHLIB_PATH</code>
</pre>
<p>If the LD_LIBRARY_PATH, LIBPATH, or SHLIB_PATH environment variable setting does not include the <code>$COBDIR/coblib</code> directory, one of the following error messages appears when you compile a program:
</p>
<ul>
<li type="disc">
<p>On Tru64:
</p>
<pre>14783 rtsora: /sbin/loader: Fatal Error: cannot map libwtc9.so
</pre>
</li>
<li type="disc">
<p>On AIX, HP, and Solaris:
</p>
<pre>ld.so.1: rts32: fatal: libfhutil.so.2.0: can't open file: errno=2
</pre>
</li>
</ul>
<br /><strong><font face="arial, helvetica, sans-serif">PATH
</font></strong><br />
<p>Set the PATH environment variable to include the <code>/opt/SUNWnsun/bin</code> directory, as follows:
</p>
<pre>$ PATH ${PATH}:<code>/opt/SUNWnsun/bin </code>
$ export PATH
</pre>
<br /><strong><font face="arial, helvetica, sans-serif">LD_LIBRARY_PATH
</font></strong><br />
<p>Set the LD_LIBRARY_PATH environment variable to include the <code>/opt/SUNWnsun/bin</code> directory, as follows:
</p>
<pre>$ LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/SUNWnsun/bin
$ export LD_LIBRARY_PATH
</pre>
<p>If the LD_LIBRARY_PATH environment variable setting does not include the <code>/opt/SUNWnsun/bin</code> directory, the following error message appears when you compile a program:
</p>
<pre>ld.so.1: cobol: fatal: liblicense.so: can't open file: errno=2
</pre>
</div class="sect3">
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref498" name="sthref498"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Pro*COBOL Oracle Runtime System <a id="sthref499" name="sthref499"></a><a id="sthref500" name="sthref500"></a><a id="sthref501" name="sthref501"></a><a id="sthref502" name="sthref502"></a>
</font>
</h3>
<p>Oracle provides its own complete runtime system, called <code>rtsora</code>, to run dynamically loadable Pro*COBOL programs. Use the <code>rtsora</code> runtime system in place of the <code>cobrun</code> runtime system provided by Merant to run dynamically loadable Pro*COBOL programs. If you attempt to run a Pro*COBOL program with <code>cobrun</code>, you receive the following error:
</p>
<pre>$ cobrun sample1.gnt
Load error : file 'SQLADR'
error code: 173, pc=0, call=1, seg=0
173 Called program file not found in drive/directory
</pre>
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref503" name="sthref503"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Pro*COBOL Demonstration Programs
</font>
</h3>
<p>Demonstration programs are provided to show the features of the Pro*COBOL precompiler. The demonstration programs are located in either the <code>$ORACLE_HOME/precomp/demo/procob</code> directory or the <code>$ORACLE_HOME/precomp/demo/procob2</code> directory, depending on the Pro*COBOL version. By default, all programs are dynamically linked with the client shared library.
</p>
<p>The programs assume that the demonstration tables created by the <code>$ORACLE_HOME/sqlplus/demo/demobld.sql</code> script exist in the SCOTT schema with the password TIGER.
</p>
<p>Use the appropriate make file to create the demonstration programs:
</p>
<ul>
<li type="disc">
<p>For Pro*COBOL release 9.2.0.1.0, use:
</p>
<pre>$ORACLE_HOME/precomp/demo/procob/demo_procob.mk
</pre>
</li>
<li type="disc">
<p>For Pro*COBOL release 1.8.77.0.0, use:
</p>
<pre>$ORACLE_HOME/precomp/demo/procob/demo_procob18.mk
</pre>
<br /><table summary="This is a layout table to format a note" title="This is a layout table to format a note" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"><tbody>
<tr>
<td align="left" colspan="1" rowspan="1">
<p>
<font face="arial, helvetica, sans-serif">
<strong>Note:</strong>
</font>
</p>The following examples assume that you are using the make file for Pro*COBOL release 9.2.0.1.0.
</td>
</tr></tbody>
</table><br />
</li>
</ul>
<p>To precompile, compile, and link the <code>sample1</code> demonstration program for Pro*COBOL, enter:
</p>
<pre>$ make -f demo_procob.mk sample1
</pre>
<p>To create all of the Pro*COBOL demonstration programs, enter:
</p>
<pre>$ make -f demo_procob.mk samples
</pre>
<p>To create and run a dynamically loadable <code>sample1.gnt</code> program to be used with the <code>rtsora</code> runtime system, enter:
</p>
<pre>$ make -f demo_procob.mk sample1.gnt
$ rtsora sample1.gnt
</pre>
<p>Some demonstration programs require you to run a SQL script, located in the <code>$ORACLE_HOME/precomp/demo/sql</code> directory. If you do not run the script, a message displays requesting you to run it. To build a demonstration program and run the corresponding SQL script, include the <code>make</code> macro argument <code>RUNSQL=run</code> on the command line. For example, to create the <code>sample9</code> demonstration program and run the required <code>$ORACLE_HOME/precomp/demo/sql</code>/<code>sample9.sql</code> script, enter:
</p>
<pre>$ make -f demo_procob.mk sample9 RUNSQL=run
</pre>
<p>To create all of the Pro*COBOL demonstration programs and run all corresponding required SQL scripts, enter:
</p>
<pre>$ make -f demo_procob.mk samples RUNSQL=run
</pre>
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref504" name="sthref504"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Pro*COBOL User Programs<a id="sthref505" name="sthref505"></a><a id="sthref506" name="sthref506"></a><a id="sthref507" name="sthref507"></a><a id="sthref508" name="sthref508"></a>
</font>
</h3>
<p>You can use the appropriate demonstration make file to create user programs, depending on the version of Pro*COBOL you are using. The syntax for creating a program with the demonstration make file is:
</p>
<ul>
<li type="disc">
<p>For Pro*COBOL release 9.2.0.1.0, enter:
</p>
<pre>$ make -f demo_procob.mk <em>target</em> COBS="<em>cobfile1</em> <em>cobile2</em> ..." EXE=<em>exename</em>
</pre>
</li>
<li type="disc">
<p>For Pro*COBOL release 1.8.77.0.0, enter:
</p>
<pre>$ make -f demo_procob18.mk <em>target</em> COBS="<em>cobfile1</em> <em>cobfile2</em> ..." EXE=<em>exename</em>
</pre>
</li>
</ul>
<p>In the preceding examples:
</p>
<ul>
<li type="disc">
<p><em><code>target</code></em> is the make file target that you want to use
</p>
</li>
<li type="disc">
<p><em><code>cobfilen</code></em> is the COBOL source file for the program
</p>
</li>
<li type="disc">
<p><em><code>exename</code></em> is the executable program
</p>
</li>
</ul>
<p>For example, to create the program <code>myprog</code>, enter one of the following commands, depending on the source and type of executable you want to create:
</p>
<ul>
<li type="disc">
<p>For COBOL source, dynamically linked with the client shared library, enter:
</p>
<pre>$ make -f demo_procob.mk build COBS=myprog.cob EXE=myprog
</pre>
</li>
<li type="disc">
<p>For COBOL source, statically linked, enter:
</p>
<pre>$ make -f demo_procob.mk build_static COBS=myprog.cob EXE=myprog
</pre>
</li>
<li type="disc">
<p>For COBOL source, dynamically loadable for use with <code>rtsora</code>, enter:
</p>
<pre>$ make -f demo_procob.mk myprog.gnt
</pre>
</li>
</ul>
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref509" name="sthref509"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
FORMAT Precompiler <a id="sthref510" name="sthref510"></a><a id="sthref511" name="sthref511"></a>Option
</font>
</h3>
<p>The <code>FORMAT</code> precompiler option specifies the format of input lines for COBOL. If you specify the default <code>FORMAT=ANSI</code>, columns 1 to 6 contain an optional sequence number, column 7 indicates comments or continuation lines, paragraph names begin in columns 8 to 11, and statements begin in columns 12 to 72.
</p>
<p>If you specify <code>FORMAT=TERMINAL</code>, columns 1 to 6 are dropped, making column 7 the left-most column.
</p>
</div class="sect2">
</div class="sect1"><a id="i28565" name="i28565"></a>
<div class="sect1">
<!--
infolevel=all
infotype=general
--><a id="sthref512" name="sthref512"></a>
<h2>
<font face="arial, helvetica, sans-serif" color="#330099">Pro*FORTRAN Precompiler (AIX, HP, Solaris, and Tru64 Only)
</font>
</h2>
<p>Before you use the Pro*FORTRAN precompiler, verify that the correct version of the compiler is installed.
</p>
<div align="center">
<br /><table summary="This is a layout table to format a tip" title="This is a layout table to format a tip" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"><tbody>
<tr>
<td align="left" colspan="1" rowspan="1">
<p>
<font face="arial, helvetica, sans-serif">
<strong>See Also:</strong>
</font>
</p><em>Oracle9i Installation Guide Release 2 (9.2.0.1.0) for UNIX Systems</em><em></em> for information on the required compiler versions on each platform, and the <em>Pro*FORTRAN Precompiler Programmer's Guide for additional information on the Pro*FORTRAN precompiler and interface features.</em>
</td>
</tr></tbody>
</table><br />
</div><a id="i28568" name="i28568"></a>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref513" name="sthref513"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Pro*FORTRAN Demonstration Programs<a id="sthref514" name="sthref514"></a>
</font>
</h3>
<p>Demonstration programs are provided to show the features of the Pro*FORTRAN precompiler. All of the demonstration programs are located in the <code>$ORACLE_HOME/precomp/demo/profor</code> directory. By default, all programs are dynamically linked with the client shared library.
</p>
<p>The programs assume that the demonstration tables created by the <code>$ORACLE_HOME/sqlplus/demo/demobld.sql</code> script exist in the SCOTT schema with the password TIGER.
</p>
<p>Use the <code>demo_profor.mk</code> make file, located in the <code>$ORACLE_HOME/precomp/demo/profor</code> directory, to create the demonstration programs. For example, to precompile, compile, and link the <code>sample1</code> demonstration program, enter:
</p>
<pre>$ make -f demo_profor.mk sample1
</pre>
<p>To create all of the Pro*FORTRAN demonstration programs, enter:
</p>
<pre>$ make -f demo_profor.mk samples
</pre>
<p>Some demonstration programs require you to run a SQL script, located in the <code>$ORACLE_HOME/precomp/demo/sql</code> directory. If you do not run the script, a message displays requesting you to run it. To build a demonstration program and run the corresponding SQL script, include the <code>make</code> macro argument <code>RUNSQL=run</code> on the command line. For example, to create the <code>sample11</code> demonstration program and run the required <code>$ORACLE_HOME/precomp/demo/sql/sample11.sql</code> script, enter:
</p>
<pre>$ make -f demo_profor.mk sample11 RUNSQL=run
</pre>
<p>To create all of the Pro*FORTRAN demonstration programs and run all corresponding required SQL scripts, enter:
</p>
<pre>$ make -f demo_profor.mk samples RUNSQL=run
</pre>
</div class="sect2"><a id="i28599" name="i28599"></a>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref515" name="sthref515"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Pro*FORTRAN User Programs
</font>
</h3>
<p>You can use the <code>$ORACLE_HOME/precomp/demo/profor/demo_profor.mk</code> make file to create user programs. The syntax for creating a program with the <code>demo_proc.mk</code> make file is:
</p>
<pre>$ make -f demo_profor.mk <em>target</em> FORS="<em>forfile1</em> <em>forfile2</em> ..." EXE=<em>exename</em>
</pre>
<p>In the preceding example:
</p>
<ul>
<li type="disc">
<p><em><code>target</code></em> is the make file target that you want to use
</p>
</li>
<li type="disc">
<p><em><code>forfilen</code></em> is the FORTRAN source for the program
</p>
</li>
<li type="disc">
<p><em><code>exename</code></em> is the executable program
</p>
</li>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -