OpenTP1 Version 7 Programming Guide

[Contents][Index][Back][Next]

8.2.2 Tasks specific to the Base sample (when using a stub)

This subsection explains how to use the Base sample. It assumes that the sample is used under the following conditions:

Shell to be used: C shell

OpenTP1 home directory: /usr/betran

Organization of this subsection
(1) Creating application programs
(2) Modifying the system definition
(3) Setting environment variables and definition files

(1) Creating application programs

Given below is the procedure for creating UAPs of the Base sample. To create UAPs of the Base sample, use the make command, a UNIX tool. A makefile dedicated to the sample is provided in the directory for the TP1/Server Base sample.

The make command should be executed on the assumption that the c/ or cobol/ directory in the aplib/ directory is the current directory.

For example, to create a UAP in the C language, enter the commands as follows:

% chdir $DCDIR/examples/base/aplib/c <CR>
% make <CR>

When these commands are executed, executable UAP files (in C) with the names basespp and basesup are created in the aplib/ directory.

(2) Modifying the system definition

The sample provides a system definition sample so that the user need not specify a system definition. For some definition files, however, the actual OpenTP1 home directory must be specified with the full pathname.

(a) Procedure for modifying the definition of the OpenTP1 home directory

The chconf command, a tool for modification, is used to change the OpenTP1 home directory from $DCDIR to the actual home directory. By executing this command, the specifications of the OpenTP1 home directory in the definition file can be changed from $DCDIR to the actual OpenTP1 home directory (/usr/betran, for example).

Before the chconf command can be executed, the user must go to the $DCDIR/example/base/conf/ directory of the sample. 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 characters in bold represent the actual OpenTP1 home directory.

Table 8-1 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 environment variable DCDIR. Otherwise, the result is unpredictable.

(b) How to restore the modified OpenTP1 home directory

To restore the modified OpenTP1 home directory to its original state, execute the bkconf command provided by the sample. This command restores the portion in the definition file that was modified by the chconf command to its initial state.

If the chconf command fails to modify the system definition, execute the bkconf command at once.

A command input example is given below.

% chdir $DCDIR/examples/base/conf <CR>
% bkconf <CR>

(3) Setting environment variables and definition files

Given below is the procedure for starting the OpenTP1 system with the created sample UAPs and sample system definition.

(a) Set the environment variable DCCONFPATH

Set the directory containing the definition files in the environment variable DCCONFPATH. After this setting, OpenTP1 can recognize the contents of the definition files.

A command input example is given below:

% setenv DCCONFPATH $DCDIR/examples/base/conf <CR>
(b) Copy the definition file env

Of 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 is already in $DCDIR/conf/ directory, it is overwritten.

Save it if necessary.

A command input example is given below:

% cp $DCDIR/examples/base/conf/env $DCDIR/conf <CR>
(c) Initialize the OpenTP1 file system

Initialize the OpenTP1 file system for Base sample using the shell file base_mkfs.

A command input example is given below:

% base_mkfs <CR>

After 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.