Professional Documents
Culture Documents
/usr/bin/ksh
############################################################################
# Shell script name : CP##_SACMDE10.ksh
#
#
DESCRIPTION: Stages dental member information.
#
#
VERSION: 1.00
#
#
LANGUAGE: Kornshell Script
#
#--------------------------------------------------------------------------#
INSTALLATION: REGENCE
#
#
PROJECT: RWR 5349 Les Schwab: Process Outgoing Dental File
#
#
DATE WRITTEN: 2013-11-08
#
#--------------------------------------------------------------------------#
#
DETAIL DESCRIPTION: This script executes the Datastage sequenceY SACMDE1
0_SEQ.
#
Note that CP##_SACMDE10 also executes the same datas
tage
#
sequence, but the ksh wrapper for each use different
#
DataStage parameters.
#
#
SPECIAL CONSIDERATIONS/RESTRICTIONS: none
#
#===========================================================================
# MODIFICATION HISTORY
#
# Date
Chg ID Developer
Release Description of Change
#===========================================================================
# 2013-11-08 r626279 Sripal Reddy
1.0
Original Write
#
#############################################################################
VendorCd=$1
### Set KshName to this script's name for use in log messaging ###
KshName=`echo $(basename $0) | cut -c 1-13`
. /opt/apps/ds/dsenv_set -u 8.1.0
echo '*************************************************************'
echo "****** ${KshName} - START
******"
echo '*************************************************************'
DatFilePath=$gcsEnvHomeDat
DSProj=`echo $0|cut -f 5 -d /`
#############################################################################
# Look up Oracle server and credentials
#############################################################################
oracleParmFile=/opt/apps/ds/$DSProj/parms/miniapps_oracle.parm
oracleSecureParmFile=/opt/apps/ds/$DSProj/parms/secure/shac_oracle_sec.parm
if [ ! -f $oracleParmFile ]
then
echo "***ERROR: oracle parm file $oracleParmFile does not exist."
exit 1
fi
. $oracleParmFile
if [ ! -f $oracleSecureParmFile ]
then
echo "***ERROR: oracle secure parm file $oracleSecureParmFile does not e
xist."
exit 1
fi
. $oracleSecureParmFile
#############################################################################
# Look up distinct Regence group ID's from import/export table
#############################################################################
exit;
EOF`
if [ $? -ne 0 ]
then
echo "Error retrieving vendor group IDs from Oracle:"
echo "******************"
echo "$rawGroupId"
echo "******************"
echo "Exiting with status 1."
exit 1
fi
while read v
do
value=`echo $v | tr -d ' \n'`
if [[ $value == '' ]]
then
continue
fi
if [ -z "$groupId" ]
then
groupId="\\\\\\'$value\\\\\\'"
else
groupId="$groupId,\\\\\\'$value\\\\\\'"
fi
done <<END
$rawGroupId
END
groupIdParm="GROUP_ID=$groupId"
echo "$groupIdParm" > "/opt/apps/ds/$DSProj/parms/shac_sacmde10_misc.parm"
echo "VENDR_CD=\\\\\\'$VendorCd\\\\\\'" >> "/opt/apps/ds/$DSProj/parms/shac_sacm
de10_misc.parm"
echo "FILENAME=PROD_REG2$VendorCd_DENTAL">> "/opt/apps/ds/$DSProj/parms/shac_sac
mde10_misc.parm"
echo "shac_sacmde10_misc.parm reads:"
cat "/opt/apps/ds/$DSProj/parms/shac_sacmde10_misc.parm"
#############################################################################
# Call the Datastage job
#
#############################################################################
cd $DatFilePath
if [ $rc -ne
then
echo
exit
else
echo
fi
0 ]
"ERROR: ${KshName}- DataStage job $DSJobName failed: See Log"
$rc
"Msg: ${KshName}- DataStage job $DSJobName successful"
echo '*************************************************************'
echo "****** ${KshName} - END
******"
echo '*************************************************************'
exit $rc
#############################################################################
# End of CP##_SACMDE10.ksh
#
#############################################################################