[Top] [Prev] [Next] [Bottom]

2. STOCKAPP Files


Directory Structure for STOCKAPP

This chapter describes the directory structure that pertains to the COBOL language binding feature under the apps directory, which is subordinate to the root directory for your BEA TUXEDO system software. We will also take a look at the files in the STOCKAPP directory. The directory structure is shown in Figure 2-1.

Figure 2-1 COBOL Directory structure under apps/

CSIMPAPP is described in Chapter 1, "Introduction and a Simple Application."

Files

Table 2-1 lists the files of the stock application. The left hand column lists the source files delivered with the BEA TUXEDO system software. The center column lists files that are generated when the stock application is built. The right hand column gives a brief summary of the purpose of the file.

Table 2-1 Stock Application Files

Source Generated Purpose

BUY.cbl

BUY.o

BUY

Client

BUYSR.cbl

BUYSR.o

BUYSR

Contains BUY service

ENVFILE

ENVFILE used by tmloadcf

FILES

Descriptive list of all the files in STOCKAPP

FUNDPR.cbl

FUNDPR.o FUNDPR

Client

FUNDPRSR.cbl

FUNDPRSR.o FUNDPRSR

Contains PRICE QUOTE service

FUNDUP.cbl

FUNDUP.o FUNDUP

Client

FUNDUPSR.cbl

FUNDUPSR.o FUNDUPSR

Contains FUND UPDATE service

README

On-line version of the installation and boot procedures

SELL.cbl

SELL.o SELL

Client

SELLSR.cbl

SELLSR.o SELLSR

Contains SELL service

STKVAR

Contains variable settings, except for those within ENVFILE

STOCKAPP.mk

Application makefile

UBBCBSHM

TUXCONFIG

Sample UBBCONFIG file for use in a SHM mode configuration

cust

CUST.cbl cust.V cust.h

View used to define structure passed between the BUY and SELL clients and the BUYSR and SELLSR servers

quote

QUOTE.cbl quote.V quote.h

View used to define structure passed between the FUNDPR and FUNDUP clients and all the servers

Of the files in the directory, eight are .cbl files; BUY.cbl, SELL.cbl, FUNDPR.cbl and FUNDUP.cbl are client programs; FUNDUPSR.cbl is a conversational server; three others are servers or are associated with servers, two are there to generate data or transactions for the application.

The remaining files have various roles; some are files you need in any application, others are present simply to facilitate the use of STOCKAPP as an example. In subsequent chapters we will closely examine a number of the files, and give a more complete explanation of their role in the sample application. For now we just want to discuss the STKVAR file.

Edit STKVAR to Set Environment Variables

STKVAR is a file of environment variables needed by STOCKAPP. A complete copy of STKVAR is shown in Listing 2-1. The file takes up almost 100 lines, due largely to the extensive comments, but there are only a few that you should be concerned about immediately.

The first line referencing TUXDIR ensures that it is set. If it is not, execution of the file fails with the message:

TUXDIR: parameter null or not set

So set TUXDIR to the root directory of your BEA TUXEDO system directory structure, and export it.

As STKVAR is delivered, APPDIR is set to the directory in which the STOCKAPP source files are located: ${TUXDIR}/apps/STOCKAPP. APPDIR is a directory where BEA TUXEDO system looks for your application-specific files. You might prefer to copy the STOCKAPP files to a different directory to safeguard the original source files. If you do, then the directory you use should be entered here. It does not have to be under TUXDIR.

The other variables specified in STKVAR play various roles in the sample application and you will need to be aware of them when you are developing your own application. They will all be mentioned at appropriate places later in this guide. Grouping them all in STKVAR is done to show you an example that you may want to adapt at a later time for use with a real application.

When you have made all necessary changes to STKVAR, execute STKVAR as follows:

. ./STKVAR

Listing 2-1 STKVAR: Environment Variables for STOCKAPP
#ident    "@(#)apps:STOCKAPP/STKVAR
#
# This file sets all the environment variables needed by the TUXEDO software
# to run the STOCKAPP
#
# This directory contains all the TUXEDO software
# System administrator must set this variable
#
TUXDIR=${TUXDIR:?}
#
# This directory contains all the user written code
#
# Contains the full path name of the directory that the application
# generator should place the files it creates
#
APPDIR=${HOME}/STOCKAPP
#
# Environment file to be used by tmloadcf
#
COBDIR=${COBDIR:?}
#
# This directory contains the cobol files needed
# for compiling and linking.
#
LD_LIBRARY_PATH=$COBDIR/coblib:${LD_LIBRARY_PATH}
#
# Add coblib to LD_LIBRARY_PATH
#
ENVFILE=${APPDIR}/ENVFILE
#
# List of field table files to be used by CBLVIEWC, tmloadcf, etc.
#
FIELDTBLS=fields,Usysflds
#
# List of directories to search to find field table files
#
FLDTBLDIR=${TUXDIR}/udataobj:${APPDIR}
#
# Set device for the transaction log; this should match the TLOGDEVICE
# parameter under this site's LMID in the *MACHINES section of the
# UBBCBSHM file
#
TLOGDEVICE=${APPDIR}/TLOG
#
# Device for the configuration file
#
UBBCBSHM=$APPDIR/UBBCBSHM
#
# Device for binary file that gives /T all its information
#
TUXCONFIG=${APPDIR}/TUXCONFIG
#
# Set the prefix of the file which is to contain the central user log;
# this should match the ULOGPFX parameter under this site's LMID in the
# *MACHINES section of the UBBCONFIG file
#
ULOGPFX=${APPDIR}/ULOG
#
# List of directories to search to find view files
#
VIEWDIR=${APPDIR}
#
# List of view files to be used by CBLVIEWC, tmloadcf, etc.
#
VIEWFILES=quote.V,cust.V
#
# Set the COBCPY
#
COBCPY=$TUXDIR/cobinclude
#
# Set the COBOPT
#
COBOPT="-C ANS85 -C ALIGN=8 -C NOIBMCOMP -C TRUNC=ANSI -C OSEXT=cbl"
#
# Set the CFLAGS
#
CFLAGS="-I$TUXDIR/include -I$TUXDIR/sysinclude"
#
# Export all variables just set
#
export TUXDIR APPDIR ENVFILE
export FIELDTBLS FLDTBLDIR TLOGDEVICE
export UBBCBSHM TUXCONFIG ULOGPFX LD_LIBRARY_PATH
export VIEWDIR VIEWFILES COBDIR COBCPY COBOPT CFLAGS
#
# Add TUXDIR/bin to PATH if not already there
#
a="\Qecho $PATH | grep ${TUXDIR}/bin\Q"
if [ x"$a" = x ]
then
PATH=${TUXDIR}/bin:${PATH}
export PATH
fi
#
# Add APPDIR to PATH if not already there
#
a="\Qecho $PATH | grep ${APPDIR}\Q"
if [ x"$a" = x ]
then
PATH=${PATH}:${APPDIR}
export PATH
fi
#
# Add COBDIR to PATH if not already there
#
a="\Qecho $PATH | grep ${COBDIR}\Q"
if [ x"$a" = x ]
then
PATH=${PATH}:${COBDIR}
export PATH
fi

On AIX, LIBPATH must be set instead of LD_LIBRARY_PATH. On HPUX, SHLIB_PATH must be set instead of LD_LIBRARY_PATH.

Additional PATH Component for SunOS

If your operating system is SunOS, you need to put /usr/5bin at the front of your PATH. The following command can be used:

PATH=/usr/5bin:$PATH;export PATH

Another requirement for SunOS users: use /bin/sh rather than csh for your shell.



[Top] [Prev] [Next] [Bottom]