Micro Focus Environment Variables | EBCDIC/ASCII Translation Tables |
If you want to compile and run on a UNIX system a CGI program that was created on NetExpress, there are certain steps that have to be taken. On NetExpress Version 2, these steps are taken for you by the UNIX Option. The UNIX Option enables you to automatically rebuild a CGI program, created using NetExpress, on a UNIX system. Instructions on how to use the UNIX option are provided in NetExpress Version 2 in the Unix Option User Guide (uopubb01.htm) . NetExpress Version 2 also provides additional information on creating and deploying Internet and intranet applications in the Internet Applications (pipubb01.htm) book.
For NetExpress Version 1, you need to manually transfer a NetExpress created program to a UNIX system, and then rebuild the program on that system. The help documentation for NetExpress Version 1 contains instructions on how to transfer and rebuild programs. However, with this version of Object COBOL for UNIX, the instructions for manually transferring and rebuilding programs has changed slightly. If you want to transfer and rebuild programs using this version of Object COBOL, ignore the instructions documented in NetExpress Version 1, and use the instructions documented here instead.
The NetExpress COBOL system has extensions to the COBOL language that enable you to create Internet applications. The UNIX COBOL systems do not directly support this syntax; however, the Htmlpp preprocessor provides this support. To recompile and run a CGI application on the UNIX system:
When you create an Internet application on NetExpress, the executable CGI program is called directly. When you transfer the program to UNIX, the CGI program must be called by a script that first sets up the environment and run-time system. This means that you must edit the form that calls the CGI program so that it calls the script instead.
You compile a CGI program using the command:
cob cgiprg.cbl -C "preprocess(htmlpp)"
where cgiprg is the name of your CGI program. If you use another preprocessor during compilation (for example, a separate SQL preprocessor), then that preprocessor can be specified in addition to the Htmlpp processor; for example:
cob cgiprg.cbl -C "preprocess(htmlpp) preprocess(otherpp)"
If you prefer, you can generate a fully preprocessed source file on one platform and compile that source file on another system. First, create the preprocessed source file:
cob cgiprg.cbl -C "noint preprocess(htmlpp) out(cgiprg.dst)"
Then on the target system, compile the resulting file:
cob -k cgiprg.dst
See your Object COBOL User Guide for detailed
information on the cob
command.
The following options are available with the Htmlpp preprocessor:
If neither the DEBUGFILE nor the OUT options are specified, by default a precompiled source listing is not produced. If both options are specified, only one output file is created, and the filename is that specified by the last-used option; for example, the options OUT "MYOUT.TXT" DEBUGFILE create filename.deb and not myout.txt.
Some options can be abbreviated; the abbrevations are indicated by the bold characters in the table above. For example, AUTOFORMAT can be abbreviated to AF, or NOAF. However, in the case of WARN, only NOWARN can be abbreviated (to NW).
When a form calls the CGI program on a UNIX system, the environment must be set up so that the CGI program will run correctly.
You should follow these rules to set the environment:
Note: COBDATA affects how the RTS locates all data files used by your application.
For example, the script shown below (cobcgi) is typical of the script that needs to be executed. It sets up the COBOL environment and runs a program called cgiapp. If you are running the program on a system with a COBOL version earlier than Version 4.1, then you run it using the rebuilt RTS. Otherwise, you can use cobrun.
# Setup COBDIR and COBPATH to locate the COBOL product # to run the program # set the location of the COBOL system COBDIR=/usr/test/cobol # Set the COBOL program search path COBPATH=:/usr/test/cobol/progs # Place these variables in your environment export COBPATH COBDIR COBDATA # Run cgiapp becomes cobrun cgiapp $*
Htmlpp accepts a superset of the syntax and functionality provided by the NetExpress:
If you have developed a program for use with the Htmlpp preprocessor, and the logic of that program relies on any of the features in the above list, and you want to port your code back to Net Express or to a different UNIX environment, then you should also use the Htmlpp preprocessor provided by this Object COBOL system in that environment.
To create a fully functioning Htmlpp preprocessor on another system, you should:
preprocess(htmlppx)
.
If the target system is a UNIX system which does not provide the Htmlpp preprocessor, place the generated code file htmlpp.gnt in the COBOL system directory ($COBDIR). Preprocessor settings in your source and build commands do not have to change.
The following errors are flagged by the Htmlpp preprocessor:
The following restrictions apply to the Htmlpp preprocessor:
cp
(default supplied by Micro
Focus) CP
If none of these are found Htmlpp will abort.
Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.
Micro Focus Environment Variables | EBCDIC/ASCII Translation Tables |