BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   Tuxedo Doc Home   |   Getting Started   |   Topic List   |   Previous   |   Next   |   Contents

   Tutorials for Developing a BEA Tuxedo Application

Step 1: How to Set Environment Variables

Environment variables required for STOCKAPP are defined in the STKVAR file. The file is large (approximately 100 lines) because it includes extensive comments.

  1. In a text editor, familiarize yourself with the STKVAR file. Line 9 ensures that TUXDIR is set. If it is not set, execution of the file fails with the following message.

    TUXDIR: parameter null or not set

  2. Set TUXDIR to the root directory of your BEA Tuxedo system directory structure, and export it.

  3. Another line in STKVAR sets APPDIR to the directory {TUXDIR}/samples/atmi/STOCKAPP which is the directory where STOCKAPP source files are located: APPDIR is a directory where the 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 enter the directory there. It does not have to be under TUXDIR.

    Note: Other variables specified in STKVAR play various roles in the sample application; you need to be aware of them when you are developing your own application. By including them in STKVAR, we provide you with a template that you may want to adapt at a later time for use with a real application.

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

    . ./STKVAR

    STKVAR: Environment Variables for STOCKAPP


    #ident    "@(#)samples/atmi: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


Additional Requirements

See Also