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


Application Overview
--------------------

This primer application demonstrates the ability of Sun MBM to execute 
batch jobs that access VSAM files.

The application programs are written in COBOL.


Prerequisites and Reference 
---------------------------
Build the Sun MTP executables using kixinstall. Be sure to select "Sun MTP
VSAM RELATIVE/INDEXED Files" as your Data Management Access and choose 
option 1 (Server Express) or option 2 (ACUCOBOL-GT) as your Application Language. 

The Sun MTP Installation Guide contains information on using kixinstall.


Contents of Directories
-----------------------
Programs    :   PRIMER.cbl
System files:   These files are copied to the directory defined by $KIXSYS
                when the build.sh file is sourced. 
                fct.tbl 
                CATALOG.dta, CATALOG.idx
Data files  :   These files are copied to the directory defined by $KIXSYS
                when the build.sh file is sourced. 
                ACCTFILE.dta, ALT1.dta, ALT3.dta,
                ACIXFILE.dta, ALT2.dta, 
                ACCTFILE.idx, ALT1.idx, ALT3.idx,
                ACIXFILE.idx, data/ALT2.idx
Other       :   README.txt
                build.sh


Setup Procedure
---------------

Set up the Sun MTP Region 

Refer to the Sun Mainframe Transaction Processing Software Configuration Guide 
for information about setting your environment, starting and stopping a 
region, and customizing the VSAM Configuration Table (VCT). 

1.  Set your environment. 
2.  Start the region and make a local client connection; for example: 

    $ unikixmain -Q 
    $ xtermunikix unikix

3.  When the copyright screen is displayed, press any key to clear it. 
4.  On a blank screen, type the CTBL transaction and press the Enter key 
   (not Return). 
5.  On the Table Manager menu, press PF4 and then PF10 to display the VCT. 
6.  On the VCT, make the following entries: 
    a. Set the number of transaction servers to 0008. 
    b. Set the maximum batch jobs to 0004. 
    c. Set the batch search interval to 0005 sec. 
    d. Type Y in the Connect to batch node field. 
    e. In the Node Dir field, type the path name to the Sun MBM node 
       installation. 
7.  Press PF2 to save the changes to the disk. 
8.  Press PF3 three times to display a blank screen. 
9.  Shut down the region. 

Create the VSAM Subsystem 
1.  Start the node. 
    a. Display the Sun MBM main menu.
       $ebmx
    b. Click the Start System icon.
2.  Start BAM and choose option 3, Applications & Subsystems. 
3.  Choose option 3, Create a Subsystem. 
4.  Type the name of the subsystem, such as vsys, and press Return. 
5.  Choose the type of COBOL you are using. 
    If you are using Server Express, go to Step 7, because Server Express is 
    the default.  
    If you are using ACUCOBOL-GT, go to Step 6. 
6.  Select ACUCOBOL-GT: 
    a. On the Create menu, choose option 1, Application Languages. 
    b. Select ACUCOBOL-GT. Server Express is automatically de-selected. 
    c. Press Return to return to the Create menu. 
7.  On the Create menu, choose option 3, Data Management. 
8.  Choose option 2 to use MTP VSAM relative/indexed files and press Return. 
9.  On the Create menu, choose option c, Create vsys Subsystem. 
10. When the COBOL environment setting screen is displayed, either:  
    Type C to use the current setting if it is correct, and press Return.  
    Type U to update the setting if it is incorrect, and press Return. 
11. On the MTP environment setting screen, type the path name of the Sun MTP 
    installation directory and press Return. This is the $UNIKIX directory. 
    It must exist or an error message is displayed. 
12. On the Region Directory screen, type the path name of the region's $KIXSYS 
    directory and press Return. This is where the region's system tables are 
    located. 
13. A series of screens will be displayed prompting you to specify various 
    environment settings: 
    a. On the System Output screen, if /tmp is displayed press Return, 
       otherwise, type /tmp and press Return. 
    b. On the JCL Jobs screen, type $EBMHOME/samples/primer/ish and press 
       Return. 
    c. On the JCL Procedures screen, type /tmp
       and press Return. 
    d. On the Application Programs screen, type $EBMHOME/samples/primer 
       and press Return. 
    e. On the Job Listing Output screen, type d to accept the default 
       and press Return.
14. When the environment setting completed message is displayed, type y to 
    save the configuration and press Return. 
15. When prompted to display log information, type y and press Return. 
16. When the runtime system created message is displayed, press Return 
    to continue. An informational screen is displayed. 
17. Press Return twice to display the BAM main menu.



Preparing the Application Components
------------------------------------

Compile the application components:
1. Display the Sun MBM main menu.
   $ ebmx
2. When the Sun MBM main menu is displayed, click the Command Prompt icon. 
   On the Command Prompt screen, type the name of the VSAM subsystem you 
   just created; in this example, vsys. 
3. Compile the COBOL program and translate the MVS JCL job by sourcing the 
   following script: 

   $  . build.sh

   This script translates the JCL, compiles the COBOL program, PRIMER.cbl,
   and copies the system and data files to the appropriate locations. 

4. Start the Sun MTP region. 
 
   $ kixstart

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

   $ kixstart -t <directory>/unikixtran


Executing the Sample Application
--------------------------------
1.  Click the System Status icon on the Sun MBM main menu. 
2.  Select the subsystem name you just created, in this example, vsys, and 
    click Submit Job. 
3.  On the Submit Job window, select the job primer and click Submit and 
    Notify. 
    Make sure the VSAM option on the window is selected. 
4.  Click OK to close the confirmation pop-up window. When the job is 
    complete, the job listing output is displayed because you selected 
    Submit and Notify. 

Shutting Down 
-------------
1. From the Sun MBM main menu, click on the Stop System icon. 
2. Stop the Sun MTP system.
   From the command line enter:
   $ kixstop

