#!/bin/ksh93
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# 61haes_r714 src/43haes/lib/ksh93/db2/KLIB_DB2_get_databases.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 
# @(#)85	1.4 src/43haes/lib/ksh93/db2/KLIB_DB2_get_databases.sh, hacmp, 61haes_r714 11/28/11 15:18:25
#
#=head1 NAME
#
# KLIB_DB2_get_databases - obtain a list of available databases discovered 
#                          in db2.disc for all instances
#
#=head1 SYNOPSIS
#
# . /usr/es/sbin/cluster/sa/db2/etc/db2.disc
# databases=$(KLIB_DB2_get_databases)
#
#=head1 DESCRIPTION
#
# Obtain a list of available databases discovered in db2.disc for all instances
#
#=head1 ARGUMENTS
#
# 	None
#
#=head1 RETURN
#
# None
#
#=head1 COPYRIGHT
#
#(C) COPYRIGHT International Business Machines Corp. 2005
#All Rights Reserved
#
#=cut
#
function KLIB_DB2_get_databases
{
	. /usr/es/lib/ksh93/func_include

	for instance in $DB2_INSTANCES; do
		val=$(eval echo \${DB2_INSTANCE_$instance["DATABASES"]})
		databases="$val $databases"
	done
	echo $databases
}
