DESCRIPTION
===========
The function library is a rich and diverse source of  modular 'primitives' or building blocks, which together ensure consistent 
handling of many DB2 and AIX operations. 
It contains a mixture of functions and procedures , many of which call each other. The library will extend over time.
For the most part, the names are self-explanatory.

The suite has been designed first and foremost for simplicity, ease of use and a consistent look and feel. 
It should be extremely easy to add significant new functionality using the existing building blocks in the function library. 
For practical and ideological reasons, all code is realised in Korn Shell and DB2 calls.

An important feature is that these modules always error log; and always return a completion code to the caller. 
They will never exit the calling shell. Therefore if you decide to roll your own scripts using this library, the degree of error checking 
in the calling script is in your hands. 

INSTALL INSTRUCTIONS
====================
How does the function library work?
FPATH is a Korn Shell variable that gives the directories to search for function definitions;
FPATH is searched when these functions are first referenced.
You execute your .profile at login;
the .profile calls $INSTHOME/sqllib/db2profile;
the db2profile calls userprofile;
and you can use the userprofile to set your FPATH.

After unzipping and untarring this file:
1. as the DB2 instance owner, move funclib to your preferred location (in the example below $INSTHOME/funclib)
2. Edit the LOGDIR,WORKDIR and TMPPATH variables to set the logging and temporary work directories in:
   REORG,RUNSTATS,SETIDENTITY and SETINTEGRITY
3. Edit the MSGPATH variable in LOAD
4. Edit $INSTHOME/sqllib/userprofile with the necessary substitutions, to contain these lines:
   export DB2INSTANCE=xxxxxxx
   export INSTHOME=xxxxxxxxxxxxxxxx  # this should already be set and exported by the db2profile
   export DBALIAS=xxxxxxxx           # this is just an optional default for the database you work on the most time,
                                     # so you can reference $DBALIAS in local scripts if you want to.
   export DBSCHEMA=xxxxxxx           # this is just a default value for the schema on which you do the most work,
                                     # so you can reference $DBSCHEMA in local scripts if you want to.
   export FPATH=$FPATH:${INSTHOME}/funclib  # or wherever you've unpacked the tar file
5. Check directory ownership and permissions - suggest r-xr-xr-- for all executables.
6. Re-execute your .profile in the current shell, e.g. . ~/.profile
   To autoload the FPATH functions, logout and back in again.

Alex Levy, Sustainable Software Ltd.
http://www.sustainablesoftware.net
