#**********************************************************************#
#*                                                                    *#
#* Copyright (c) 2004 by Sun Microsystems, Inc.                       *#
#* All rights reserved.                                               *#
#*                                                                    *#
#**********************************************************************#


Application Overview
--------------------
This Primer application demonstrates the ability of Sun MTP to execute 
embedded SQL code within CICS transactions and access an Oracle database.

The application programs are written in COBOL and executed in 
ACUCOBOL-GT(R) runtime.


Prerequisites and Reference
---------------------------
Build the Sun MTP executables using kixinstall. Be sure to select 
"ACUCOBOL-GT" as your application language and "Oracle" as 
your RDBMS. 

Make a note of the target directory for the executables that you 
specify during the build process.

The Sun MTP Installation Guide contains information on using 
kixinstall.

Read the MTP Configuration Guide, specifically the chapter on 
configuring a region to work with an RDBMS.


Contents of Directories
-----------------------
Programs    : progs/ACCT00.cl2, progs/ACCT01.pco, progs/ACCT02.pco,
              progs/ACCTBTCH.bth, progs/ACCTFET.pco
Maps        : maps/ACCTSET.bms
Copybooks   : progs/ACIXREC, progs/ACCTREC, progs/HISTSET 
DDLs        : util/createdemo.sql, util/dropdemo.sql,
              util/actrec.ctl, util/acctocrs.ctl
System files: sys/CATALOG.dta, sys/CATALOG.idx, sys/pct.tbl, sys/ppt.tbl,
              sys/sit.tbl, sys/vct.tbl
Other       : makefile, setup, README.txt, util/batch.sh


Setup Procedure
---------------
1.   Copy the $UNIKIX/examples/oracle/cobol_acu directory structure to 
     a new location.

2.   Change to that directory.

3.   Edit the setup file for your environment.

4.   Source the setup file.


Preparing the Application Components
------------------------------------
1.   Log in as the Oracle administrator and bring up an Oracle session.

2.   Create the Oracle database:

     SQL> GRANT connect,resource to unikix identified by unikix;

3.   Log out as the Oracle administrator.

4.   Log in as the MTP user, if necessary.

5.   Create the database tables for the sample application:

     $ sqlplus unikix/unikix @util/createdemo.sql

     The script creates tables in the database 'unikix' which is also the
     database name in the System Initialization Table.

6.   Load the sample data:

     $ sqlldr control=util/actrec.ctl   userid=unikix/unikix
     $ sqlldr control=util/acctocrs.ctl userid=unikix/unikix

     Note: If you are using older versions of Oracle (e.g. 8.1.6) you will
           have to use "sqlload" instead of "sqlldr". Refer to the Oracle
           documentation.

7.   Compile the application components:

     $ make


Executing the Sample Application
--------------------------------
1.   Start the region.

     $ kixstart

     Note - If you specified a different target directory during the kixstall
     process, you must use the -t option and specify the path name:

       $ kixstart -t <directory>/unikixtran


2.   Start a user session. For example, to start a local client type:

     $ ncd101unikix unikix

3.   On a blank transaction screen, type ACCT and press Enter.

4.   On the ACCOUNT FILE: MENU screen, type G in the Surname field.

     The Greenfield entries are displayed.

5.   Try the other functions of the application.

     Note: The 'P' (print) option is not supported.

6.   When you are finished, press the Clear key to exit the application.

7.   To test the batch program:

     $ cp util/batch.sh $KIXBTCH

     The batch program will be executed automatically and then deleted
     from the $KIXBTCH directory.


Shutdown procedures
-------------------
1.   Stop the Sun MTP system using either method:

     - Type the kixstop command at the shell prompt.
     - Type CSMT SHUT,YES on a blank transaction screen.

2.   Delete the database tables for the sample application:

     $ sqlplus unikix/unikix @util/dropdemo.sql

3.   Log in as the Oracle administrator and bring up an Oracle session.

4.   Delete the 'unikix' database in the Oracle instance:

     SQL> DROP user unikix;

5.   Log out as the Oracle administrator.

6.   Log in as the MTP user, if necessary.

7.   Remove all the compiled programs and BMS maps:

     $ make clean
