#!/bin/ksh93
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# 61haes_r714 src/43haes/lib/ksh93/db2/KLIB_DB2_disc_get_instance_value.sh 1.4 
#  
# Licensed Materials - Property of IBM 
#  
# Restricted Materials of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2005,2011 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
# @(#)86	1.4 src/43haes/lib/ksh93/db2/KLIB_DB2_disc_get_instance_value.sh, hacmp, 61haes_r714 11/28/11 15:20:19
#
#=head1 NAME
#
# KLIB_DB2_disc_get_instance_value - Get the DB2 instance discovery information out the
#				     discovery source file
#
#=head1 SYNOPSIS
#
# #Gather the Db2 instance databases for DB2 instance: db2inst1
#
# value=$(KLIB_DB2_disc_get_instance_value "db2inst1" "DATABASES")
#
#=head1 DESCRIPTION
#
# Obtains the DB2 instance discovery information from the hash array that exists in the
# DB2 discovery source file, this function assumes that /usr/es/sbin/cluster/sa/db2/db2.disc
# has already been sourced.
#
#=head1 ARGUMENTS
#
# 	1: [scalar] name of DB2 instance to get information for
#	2: [scalar] name of the hash key to retrieve data from
#
#=head1 RETURN
#
#	echo's value of hash[$key] to stdout
#
#=head1 COPYRIGHT
#
#(C) COPYRIGHT International Business Machines Corp. 2005
#All Rights Reserved
#
#=cut
#
function KLIB_DB2_disc_get_instance_value
{
	. /usr/es/lib/ksh93/func_include

	typeset instance=$1
	typeset value=$2

	echo $(eval echo \${DB2_INSTANCE_$instance["$value"]})
}
