#函数描述:检查程序是否是唯一运行的
#输入参数
# $1 需要检查的进程名称
#返回值:
# 0 目前只有一个进程正在运行
# 1 目前已有进程正在运行
#调用方式:CheckUnique 程序名称
CheckUnique()
{
if [ $# -ne 1 ]; then
Log "ERROR:The input arguments of function CheckUnique missed."
return 1
fi
PSName=$1
pid=$$
## Begin modify by yuming, 2006-11-21 18:28, PPSV800R004C03B202, DefectNo: 002122
#ps -ef|grep $PSName |grep $LOGNAME>tempfile.$$
if [ "-$MachineType" = "-SunOS" ]; then
########################### Modify by zhouya 2007-01-04 Begin #########################
#ps -u $LOGNAME -o pid -o args | grep $PSName | grep $LOGNAME>tempfile.$$
ps -u $LOGNAME -o pid -o args >tempfile.$$
########################### Modify by zhouya 2007-01-04 End #########################
elif [ "-$MachineType" = "-HP-UX" ]; then
#ps -xu $LOGNAME | grep $PSName | grep $LOGNAME>tempfile.$$
ps -xu $LOGNAME >tempfile.$$
elif [ "-$MachineType" = "-AIX" ]; then
#ps -efl | grep $PSName | grep $LOGNAME>tempfile.$$
ps -efl >tempfile.$$
elif [ "-$MachineType" = "-Linux" ]; then
#ps -efw | grep $PSName | grep $LOGNAME>tempfile.$$
ps -efw >tempfile.$$
fi
## End modify by yuming, 2006-11-21 18:28, PPSV800R004C03B202, DefectNo: 002122
#cat tempfile.$$|grep -v grep|grep -v $pid |grep -v root |grep -v "c $PSName"|read result
#Begin Modify by zhujielong 20061106 for PPSV8.4D3 Linux移植
#cat tempfile.$$|grep -v grep|grep -v $pid |grep -v root |grep -v csh |grep -v "$PSName.log" |grep -v "tail " |grep -v "c $PSName"|read result
########################### Modify by zhouya 2007-01-04 Begin #########################
#result=`cat tempfile.$$|grep -v grep|grep -v $pid |grep -v root |grep -v csh |grep -v "$PSName.log" |grep -v "tail " |grep -v "c $PSName"`
result=`cat tempfile.$$ | grep $PSName | grep $LOGNAME |grep -v grep|grep -v $pid |grep -v root |grep -v csh |grep -v "$PSName.log" |grep -v "tail " |grep -v "c $PSName"`
########################### Modify by zhouya 2007-01-04 End #########################
#End Modify by zhujielong 20061106 for PPSV8.4D3 Linux移植
SafeExec rm -f tempfile.$$ >/dev/null 2>> $LogFile
if [ "-${result}" = "-" ]; then
Log "Only one $PSName is running!"
else
Log "Error: There is another $PSName that is already running."
return 1
fi
return 0
}
#########################################################################
#函数名称:IsValidDate
#功能 检查输入的日期是否是一个合法的日期
#输入参数
# 日期字符串
#输出
# 无
#返回
# 0 输入日期为合法日期
# 1 输入日期为不合法日期
IsValidDate()
{
InputDate=$1
time=`dtms show_dt2time $InputDate`
if [ $? -ne 0 ];then
return 1
fi
tmpOutputDate=`dtms show_time2dt $time`
if [ $? -ne 0 ];then
return 1
fi
OutputDate=`echo ${tmpOutputDate}| cut -c 1-8`
if [ "-${InputDate}" != "-${OutputDate}" ];then
return 1
fi
return 0
}
##################Begin add by zhutao PPSV8.3D1 20051108####################
#函数名称:numcmp
#功 能:比较两个整数的大小,可以进行长度为10位以上大数的比较
#输入参数:
# 整数1,整数2
#输出:
# 无
#返回:
# 0 参数1 等于 参数2
# 1 参数1 大于 参数2
# 2 参数1 小于 参数2
#说明: 无
numcmp()
{
number1=$1
number2=$2
#两个数相等
if [ ${number1} = ${number2} ]; then
res=0
#两个数不相等
else
#判断正负数
signal1=`expr "${number1}" : '\(.\)'`
signal2=`expr "${number2}" : '\(.\)'`
#参数1为负数参数2为整数
if [ "${signal1}" = "-" -a "${signal2}" != "-" ]; then
res=2
#参数1为整数参数2为负数
elif [ "${signal1}" != "-" -a "${signal2}" = "-" ]; then
res=1
#两个都为负数
elif [ "${signal1}" = "-" -a "${signal2}" = "-" ]; then
numlen1=${#number1}
numlen2=${#number2}
if [ ${numlen1} -lt ${numlen2} ]; then
res=1
elif [ ${numlen1} -gt ${numlen2} ]; then
res=2
else
echo ${number1} >temp.unl
echo ${number2} >>temp.unl
greater=$(sort temp.unl|head -1)
if [ ${greater} = ${number1} ]; then
res=1
else
res=2
fi
rm temp.unl
fi
#两个都为整数
else
numlen1=${#number1}
numlen2=${#number2}
if [ ${numlen1} -lt ${numlen2} ]; then
res=2
elif [ ${numlen1} -gt ${numlen2} ]; then
res=1
else
echo ${number1} >temp.unl
echo ${number2} >>temp.unl
smaller=$(sort temp.unl|head -1)
if [ ${smaller} = ${number1} ]; then
res=2
else
res=1
fi
rm temp.unl
fi
fi
fi
return ${res}
}
##################End add by zhutao PPSV8.3D1 20051108#######################
############################################################################
#函数名称:Clearup
#函数描述:清除运行时的临时文件
#输入参数:无
# FileList 是在SetRuntimeEnv函数中创建的文件列表,需要在SetRuntimeEnv函数中赋值
#返回值:
# 0 成功
# 1 失败
#调用方式:Clearup
Clearup()
{
#删除临时报表文件
for FileName in $FileList
do
if [ -f $FileName ];then
rm -f $FileName
if [ $? -ne 0 ];then
Log "Error:Fail to delete file:$FileName"
fi
fi
done
}
SafeExec()
{
$*
if [ $? -ne 0 ]; then
Log "ERROR:exec $* FAILED! "
##################Begin add by xujinping PPSV8.3D1 20051009####################
sendAlarm "275000012" "$*" "SMPSER: Failed to execute ksh command in $ProgName."
##################End add by xujinping PPSV8.3D1 20051009####################
exit 1
fi
}
#PPSV800R004C04B30 added by zhangzhifa60015597 2007-02-02 begin
#=============================================================
#通用sftp功能
#功能 在指定的机器的指定的目录下执行指定的sftp命令
#输入参数
# [ username ]用户名和密码
# [ -path iniatial paht ] 初始目录
# ipaddress 地址
# command 可以是多个参数,命令列表
#返回值:
# 0 成功
# 1 程序运行环境不具备
#SftpFun [ username ] [ -path $initial-path ] ipaddress command
#=============================================================
SftpFun()
{
if [ $# -lt 4 ] ; then
echo "USAGE: SftpFun [ username ] [ -path $initial-path ] ipaddress command"
return 1
fi
username="$1"
shift 1
#检查要进入的路径
if [ "$1" = "-path" ]; then
shift
ftppath=$1
shift
else
ftppath=""
fi
# 判断是否同时输入了机器名和命令
if [ $# -lt 2 ] ; then
Log "ERROR: Machine or command not input!"
return 1
fi
#ip地址
machine=$1
shift
#命令
command=$1
shift
#ftp错误输出文件
#输出结果文件,如果没有定义该文件,则在函数内部自定义文件
if [ "-${ftpoutputfile}" = "-" ];then
ftpoutputfile=$TmpDir/ftpoutput.tmpunl
fi
#删除以前可能存在的文件
ftperrorfile=$TmpDir/ftperror.tmpunl
rm -f $ftpoutputfile>/dev/null 2>&1
rm -f $ftperrorfile>/dev/null 2>&1
touch $ftpoutputfile>/dev/null 2>&1
touch $ftperrorfile>/dev/null 2>&1
machinetype=`uname -s`
# 在 HP 机器上只罗列文件要使用 nlist
if [ $command = "ls" ] && [ $machinetype = "HP-UX" ] ; then
command="nlist"
fi
# 对 sun 的机器只能使用ls,无nlist命令
if [ $command = "nlist" ] && [ $machinetype = "SunOS" ]; then
command="ls"
fi
# 记录开始时间
BeginTime=$SECONDS
# 开始执行sftp
sftp $username@$machine <<EOF >${ftpoutputfile} 2>${ftperrorfile}
cd $ftppath
$command $*
bye
EOF
# 判断是否超出等待时间
SFTPTime=`expr $SECONDS - $BeginTime`
if [ $SFTPTime -gt 1800 ]; then
rm -f $ftpoutputfile>/dev/null 2>&1
rm -f $ftperrorfile>/dev/null 2>&1
Log "WARNNG: This SFTP process $$ is timeout!"
return 1
fi
#过滤连接信息
tmpftperrorfile=$TmpDir/tempftperror.tmpunl
cat $ftperrorfile | grep -v "Connecting to" >$tmpftperrorfile
SafeExec mv $tmpftperrorfile $ftperrorfile
filenotfind=`cat $ftperrorfile | grep "No such file"`
if [ "-$filenotfind" != "-" ];then
# Log "ERROR:File not find in machine:$machine"
Log "ERROR:File or directory not find in machine:$machine"
return 2
fi
#检查是否文件不存在
filenotfind=`cat $ftperrorfile | grep "not found"`
if [ "-$filenotfind" != "-" ];then
Log "ERROR:Files not find in machine: $machine"
return 2
fi
#检查是否存在其他错误
while read errinfo
do
if [ "-${errinfo}" != "-" ] ; then
return 1
fi
done < $ftperrorfile
if [ "-$command" = "-ls" -o "-$command" = "-dir" -o "-$command" = "-nlist" ]; then
rm -f $ftperrorfile
return 0
fi
if [ ! -s $ftpoutputfile ]; then
return 0
fi
#删除ftp处理过程中的临时文件
rm -f $ftpoutputfile>/dev/null 2>&1
rm -f $ftperrorfile>/dev/null 2>&1
return 0
}
#PPSV800R004C04B30 added by zhangzhifa60015597 2007-02-02 end
#********************************4.ftpfun**************************************
#通用ftp功能
#本程序中调用格式:ftpfun <-user $username $password> $type $machine $command
#如果第一个参数为"-user",则必须给出用户名和密码。(可选)
#否则从type开始,type只能是"-ascii"或"-bin",表示传输模式。(必选)
#接下来是要登录的机器的IP地址(必选)
#最后是命令行,格式不限,如:ls cshrc。一次只有一个命令。(必选)
#调用此函数前需要事先定义的变量为ftpoutfile、ftperrfile、cd_dir,含义如下:
# ftpoutfile ftp执行命令后的结果文件
# ftperrfile ftp错误文件
# cd_dir ftp到远端登录后,需要进入的相对目录名,可以为空,默认为当前目录
#需调用的函数:Log()
ftpfun()
{
if [ $# -lt 3 ] ; then
echo "USAGE: ftpfun [<-user username password>] <type> <machine> <command>"
return 1
fi
if [ "x${ftpoutfile}" = "x" ]; then
Log "ERROR: ftpoutfile is not defined!"
return 1
fi
echo "" >$ftpoutfile >/dev/null 2>&1
if [ ! -f $ftpoutfile ]; then
Log "ERROR: ftpoutfile : $ftpoutfile is an incorrect file!"
return 1
fi
if [ "x${ftperrfile}" = "x" ]; then
Log "ERROR: ftperrfile is not defined!"
return 1
fi
echo "" >$ftperrfile >/dev/null 2>&1
if [ ! -f $ftperrfile ]; then
Log "ERROR: ftperrfile : $ftperrfile is an incorrect file!"
return 1
fi
if [ "x$1" = "x-user" ]; then
shift
if [ $# -lt 2 ] ; then
Log "ERROR:username or password is not defined for function ftpfun!"
return 1
fi
username="$1"
password="$2"
shift 2
fi
if [ "x$1" = "x-ascii" ]; then
type="ascii"
shift
else
if [ "x$1" = "x-bin" ]; then
type="bin"
shift
else
Log "ERROR: transfer type = $1 is not right for function ftpfun!"
return 1
fi
fi
if [ $# -lt 2 ] ; then
Log "ERROR: machine or command is not defined for function ftpfun!"
return 1
fi
machine=$1
shift
command=$1
shift
#printf "" > $errfile
if [ $command = "ls" ]; then
machinetype=`uname -s`
if [ $machinetype = "HP-UX" ]; then
command="nlist"
fi
fi
#add by wengzhiqiang 2000-02-28
BeginTime=$SECONDS
#开始执行ftp
if [ "x$username" = "x" ]; then
ftp -i $machine <<EOF >$ftpoutfile 2>$ftperrfile
cd $cd_dir
$type
$command $*
bye
EOF
else
ftp -in $machine <<EOF >$ftpoutfile 2>$ftperrfile
user $username $password
cd $cd_dir
$type
$command $*
bye
EOF
fi
#Begin add by wengzhiqiang 2000-02-20
FTPTime=`expr $SECONDS - $BeginTime`
# *** BEGIN *** 修改单号: ovs393,2002-01-09,黄闽军 modify
# 修改原因:当KPI文件很大时,从SCP取话单超时,此时KPI统计报表无法生成,
# 延长超时时间,同时,超时后不从程序退出,去掉exit语句
# 原代码: if [ $FTPTime -gt 900 ]; then
#修改为:
if [ $FTPTime -gt 1800 ]; then
Log "`date '+%Y-%m-%d %H:%M:%S` WARNNG:This FTP process $$ is timeout!"
#rm -f $errfile
#exit 1
fi
#end add by wengzhiqiang 2000-02-20
# *** END *** 修改单号:ovs393,2002-01-09, 黄闽军 modify
filenotfind=`cat $ftpoutfile |grep "can't find"`
if [ "-$filenotfind" != "-" ];then
Log "ERROR:File not find in machine:$machine"
return 2
fi
filenotfind=`cat $ftpoutfile |grep "No such file"`
if [ "-$filenotfind" != "-" ];then
Log "ERROR:File not find in machine:$machine"
return 2
fi
while read errinfo
do
if [ "-${errinfo}" != "-" ] ; then
return 1
fi
done < $ftperrfile
if [ "-$command" = "-ls" -o "-$command" = "-dir" -o "-$command" = "-nlist" ]; then
rm -f $ftperrfile
return 0
fi
if [ ! -s $ftpoutfile ]; then
return 0
fi
#否则ftpfun 出错
#不用删除$ftpoutfile $errfile
#rm -f $ftpoutfile
#rm -f $errfile
## Begin modify by yuming, 2006-9-29 13:50, PPSV800R004C02B102, SMPSER获取SCP列表问题
#return 1
return 0
## End modify by yuming, 2006-9-29 13:50, PPSV800R004C02B102, SMPSER获取SCP列表问题
}
#================================4.ftpfun=============================
#********************************5.LOAD TO DATABASE**************************************
#函数功能:根据关键字,生成删除$TabName表中重复记录的SQL语句文件
#程序说明:当LoadMode=add时,数据文件的第一列必须为判断是否是重复记录的关键字
# 本函数根据第一列的关键字生成删除重复记录用的SQL文件
GenDelSql()
{
if [ $# -ne 3 ]; then
Log "ERROR:Missing parameter !"
Log "GenDelSql $*"
return 1
fi
tablename=$1
datafile=$2
delsqlfile=$3
awk 'BEGIN { FS="|" ; }
{printf "delete from %s where key =\"%s\";\n",tablename,$1;}
' tablename=$tablename $datafile > $delsqlfile
if [ $? -ne 0 ]; then
Log "ERROR: Filter $datafile to general delete sql file FAILED !"
#rm -f $delsqlfile
return 1
fi
}
DelExcesRptFile()
{
#当天日期
DATE=`date '+%Y%m%d'`
#当年年号
YEAR=`date '+%Y'`
#当月月号
MONTH=`date '+%m'`
#当天天号
DAY=`date '+%d'`
if [ $MONTH = "01" ]; then
LASTYEAR=`expr $YEAR - 1`
LASTMONTH="12"
else
LASTYEAR=$YEAR
LASTMONTH=`expr $MONTH - 1`
if [ $LASTMONTH -lt 10 ]; then
LASTMONTH="0"${LASTMONTH}
fi
fi
LASTDAY=$DAY
LASTDATE=${LASTYEAR}${LASTMONTH}${LASTDAY}
OldRptFile=${2}_${LASTDATE}.'*'
SafeExec cd $1
RptTmpFile=$TmpDir/rpttmpfile
ls -1 ${2}_2*.* > $RptTmpFile 2>/dev/null
while read OneRptFile
do
if [ -f $OneRptFile ]; then
OneRptFileDate=`echo $OneRptFile | awk '{print substr($1,length(tmp)+2,8);}' tmp=$2`
if [ $OneRptFileDate -le $LASTDATE ]; then
rm -f $OneRptFile
fi
fi
done < $RptTmpFile
rm -f $RptTmpFile
SafeExec cd $SMS_RUN
}
############################ Begin add by ganquan 2000-04-18 ##########
#时间转换函数
#用法:TimeTrans <InputDate:yyyymmdd> <+|-> <Days>
#参数说明:
# InputDate -- 输入日期 格式:yyyymmdd
# +|- -- 增/减
# Days -- 增减的天数
#输出:
# 转换后的日期
TimeTrans()
{
if [ $# -ne 3 ]; then
echo "Usage: TimeTrans <InputDate:yyyymmdd> <+|-> <Days>"
return 1
fi
DateIn=$1
OperKey=$2
Days=$3
TimeIn=`dtms show_dt2time $DateIn`
OffsetSeconds=`echo "${Days}*86400" | bc`
if [ $OperKey = "+" ]; then
TimeOut=`expr $TimeIn + $OffsetSeconds`
else
TimeOut=`expr $TimeIn - $OffsetSeconds`
fi
DateOut=`dtms show_time2dt $TimeOut`
echo $DateOut | awk '{print substr($1,1,8);}'
return 0
}
Yestoday=`TimeTrans $DATE - 1`
######
######
#判断是否为非负整数
#用法: IsPositiveInt <Number>
#参数说明: number --数值
#输出:无
#
IsPositiveInt()
{
#expr 1 + $1 >>/dev/null
expr 1 + $1 >/dev/null 2>&1
if [ $? -ne 0 ]; then
return 1
fi
if [ $1 -lt 0 ]; then
return 1
fi
#Begin Modify by zhujielong 20061106 for PPSV8.4D3 Linux移植
#echo $1 | grep -v "\."|read number
number=`echo $1 | grep -v "\."`
#End Modify by zhujielong 20061106 for PPSV8.4D3 Linux移植
if [ "x${number}" = "x" ]; then
return 1
fi
return 0
}
##################Begin add by 邓福喜 2005.03.15###############################
#IsNumeric
#功能 检查输入的字符串是否为一个数字字符串
#输入参数
# $1 日期
#输出
# 无
#返回
# 0 输入字符串为一个数字字符串
#
# 1 输入字符串不是一个数字字符串
#
IsNumeric()
{
if [ $# -ne 1 ];then
Log "ERROR:Wrong input arguments to call function IsNumeric."
Log "$*"
return 1
fi
test_string=$1
if [ "-${test_string}" = "-" ]; then
return 1
fi
temp_string=""
temp_string=`expr $test_string + 0` >/dev/null 2>&1
if [ "-$temp_string" = "-" ]; then
return 1
fi
return 0
}
#函数名称:IsValidTime
#功能 检查输入的时间是否是一个合法的时间
#输入参数
# 时间字符串
#输出
# 无
#返回
# 0 输入时间为合法时间
# 1 输入时间为不合法时间
IsValidTime()
{
if [ $# -ne 1 ];then
Log "ERROR:Wrong input arguments to call function IsValidTime."
Log "$*"
return 1
fi
#检查长度
length=`echo $1 | awk "{print length(\\$1)}"`
if [ $length -ne 6 ];then
return 1
fi
#检查是否数字字符串
IsNumeric $1
if [ $? -ne 0 ];then
return 1
fi
#将其转化为数字
tmpHour=`echo $1 | cut -c 1-2`
tmpMinute=`echo $1 | cut -c 3-4`
tmpSecond=`echo $1 | cut -c 5-6`
tmpHour=`expr $tmpHour + 0`
tmpMinute=`expr $tmpMinute + 0`
tmpSecond=`expr $tmpSecond + 0`
if [ tmpHour -gt 23 ]; then
return 1
fi
if [ tmpMinute -gt 59 ]; then
return 1
fi
if [ tmpSecond -gt 59 ]; then
return 1
fi
return 0
}
#函数名称:IsValidDateTime
#功能 检查输入的日期时间是否是一个合法的日期时间
#输入参数
# 日期时间字符串
#输出
# 无
#返回
# 0 输入日期时间为合法日期时间
# 1 输入日期时间为不合法日期时间
IsValidDateTime()
{
if [ $# -ne 1 ];then
Log "ERROR:Wrong input arguments to call function IsValidDateTime."
Log "$*"
return 1
fi
#检查长度
length=`echo $1 | awk "{print length(\\$1)}"`
if [ $length -ne 14 ];then
return 1
fi
tmpDate=`echo $1 | cut -c 1-8`
tmpTime=`echo $1 | cut -c 9-14`
IsValidDate $tmpDate
if [ $? -ne 0 ]; then
return 1
fi
IsValidTime $tmpTime
if [ $? -ne 0 ]; then
return 1
fi
}
##################End add by 邓福喜 2005.03.15###############################
##################Begin add by xujinping PPSV8.3D1 20051009####################
#函数名称:sendAlarm
#功能 发送OAM告警
#输入参数:
# 告警ID,告警的location信息,告警信息
#输出:
# 无
#返回:
# 成功 0;失败 1
#说明: 此函数调用OAM提供的shellnoticebysocket来进行告警。
sendAlarm()
{
if [ $# -ne 3 ];then
Log "ERROR: Wrong input arguments to call function sendAlarm."
Log "$*"
return 1
fi
##访问[system]下的functionoam是否为1来决定是否告警
CfgItem="functionoam"
functionoam=`do_dealconfig $ReadFunc $ConfigReportFile $FIELD_SYSTEM $CfgItem `
if [ $? -ne 0 ];then
return 1
fi
if [ "-$functionoam" = "-1" ];then
if [ -f $SMS_DIR/bin/shellnoticebysocket -a -x $SMS_DIR/bin/shellnoticebysocket ];then
shellnoticebysocket a 0 "$1" 0 "$2" "$3"
fi
fi
return 0
}
#函数名称:oamReport
#功能 验证报表是否存在,如果不存在则发送OAM告警
#输入参数:
# 文件的路径
#输出:
# 无
#返回:
# 成功 0;失败 1
#说明: 此函数调用sendAlarm进行告警
assertReport()
{
if [ $# -ne 1 ];then
Log "ERROR: Wrong input arguments to call function assertReport."
Log "$*"
return 1
fi
if [ ! -f $1 ];then
sendAlarm "275000001" "$ProgName_$1" "SMPSER: Failed to generate $1."
if [ $? -ne 0 ];then
#Log "ERROR: Can not send alarm to oam in $ProgName"
return 1
fi
fi
return 0
}
#函数名称:oamDatabase
#功能 数据库访问失败的时候条用此函数进行告警
#输入参数:
# 访问的数据库表或者存储过程
#输出:
# 无
#返回:
# 成功 0;失败 1
#说明: 此函数调用sendAlarm进行告警
oamDatabase()
{
if [ $# -ne 1 ];then
Log "ERROR: Wrong input arguments to call function oamDatabase."
Log "$*"
return 1
fi
if [ ! -f $1 ];then
sendAlarm "275000005" "$ProgName_$1" "SMPSER: Failed to access Database in $ProgName."
if [ $? -ne 0 ];then
#Log "ERROR: Can not send alarm to oam in $ProgName"
return 1
fi
fi
return 0
}
##################End add by xujinping PPSV8.3D1 20051009#######################
###############PPSV8.0D6 xujinping add begin##################
#time transfer function
#Usage:TimeTransSec <InputDate:yyyymmddhhmiss> <+|-> <Seconds>
#parameter description:
# InputDate --input date, format:yyyymmddhhmiss
# +|- --plus|minus
# Seconds
#output:
# yyyymmddhhmiss
TimeTransSec()
{
if [ $# -ne 3 ]; then
echo "Usage: TimeTransSec <InputDate:yyyymmddhhmiss> <+|-> <Seconds>"
return 1
fi
DateIn=$1
OperKey=$2
Seconds=$3
TimeIn=`dtms show_dt2time $DateIn`
if [ $OperKey = "+" ]; then
TimeOut=`expr $TimeIn + $Seconds`
else
TimeOut=`expr $TimeIn - $Seconds`
fi
DateOut=`dtms show_time2dt $TimeOut`
echo $DateOut
return 0
}
###############PPSV8.0D6 add end##################