OpenTP1 Version 7 Programming Guide
This subsection describes the preparation procedure specific to the Base sample when using dynamic loading of service functions. The description assumes that the sample is used under the following conditions:
The procedure for creating UAPs from the Base sample when using dynamic loading of service functions is given below. To create a sample program, use the UNIX make command. A makefile for the sample is provided in the directory for the Base sample.
The make command should be executed with the current directory set to the c/ or cobol/ directory in the aplib/ directory.
For example, to create a UAP in C language, enter the commands as follows:
% chdir $DCDIR/examples/base/aplib/c <CR> % make -f make_svdl <CR>
When these commands are executed, executable UAP files (in C) with the names basespp2 and basesup2 are created in the aplib/ directory.
A sample definition file is provided with the sample, to save the user the trouble of modifying the system definition. However, for some definition files, the actual OpenTP1 home directory must be specified as an absolute path.
The chconf command, a configuration tool, is used to change the OpenTP1 home directory from $DCDIR to the actual home directory. By executing this command, the references to the OpenTP1 home directory in the definition file can be changed from the placeholder $DCDIR to the actual OpenTP1 home directory (/usr/betran, for example).
Before executing the chconf command, navigate to the $DCDIR/examples/base/conf/ directory. A command input example is given below:
% chdir $DCDIR/examples/base/conf <CR> % chconf <CR>
When the chconf command is executed, the contents of the following definition files are modified. The portion in bold is changed to the actual OpenTP1 home directory.
Table 8-3 Definition files and content to be modified (Base sample)
Definition file to be modified | Modification |
---|---|
env | putenv DCCONFPATH $DCDIR/examples/base/conf |
prc | putenv prcsvpath $DCDIR/examples/base/aplib |
sts | Physical file name: $DCDIR/examples/base/betranfile/xxx |
sysjnl | Physical file name: $DCDIR/examples/base/betranfile/xxx |
cdtrn | Physical file name: $DCDIR/examples/base/betranfile/xxx |
Before this tool (chconf command) can be executed, the OpenTP1 home directory must be defined in the DCDIR environment variable. Otherwise, the files are not modified correctly.
Because the UAP shared library name (containing $DCDIR) specified in the service operand of basespp2 and BASESPP2 is specified using an environment variable, executing the chconf command will not change references to this file in the definition files.
To restore the modified OpenTP1 home directory to its original state, execute the bkconf command provided to undo the change. This command restores the parts of the definition files modified by the chconf command to their initial state.
If the chconf command fails to modify the system definition in the manner expected, immediately execute the bkconf command.
A command input example is given below:
% chdir $DCDIR/examples/base/conf <CR> % bkconf <CR>
The procedure for starting the OpenTP1 system with the created sample UAPs and sample system definition is given below.
Set the directory containing the definition files as the value of the environment variable DCCONFPATH. This allows OpenTP1 to recognize the contents of the definition files.
A command input example is given below:
% setenv DCCONFPATH $DCDIR/examples/base/conf <CR>
Of the definition files, only the env file must be read from $DCDIR/conf into OpenTP1. Therefore, the env definition file created as a sample must be moved to $DCDIR/conf.
If an env definition file has already been created in the $DCDIR/conf/ directory, it will be overwritten. Back up the existing file if necessary.
A command input example is given below:
% cp $DCDIR/examples/base/conf/env $DCDIR/conf <CR>
Initialize the OpenTP1 file system for the Base sample by executing the shell file base_mkfs.
A command input example is given below:
% base_mkfs <CR>
When this shell file is executed, a file named betranfile is created under the $DCDIR/examples/base/ directory and the OpenTP1 file system is established under that file.
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.