Date Problem in Script [message #334860] |
Fri, 18 July 2008 07:12 |
balaji23_d
Messages: 123 Registered: February 2007
|
Senior Member |
|
|
Hi,
when i execute this script,I am getting the null value passeing in the Pro_Date.Upto Num1 i getting the value.But when the loop comes to the Pro_Date,Its not getting hte value,It returns the null value.Please help me to how to overcome this problem
Name=Fastpymt
DIR='/usr1/home/bnrprod'
DIR1='/usr1/home/bnrprod'
File=$DIR1/fastpymt.txt
File1=$DIR/${Name}ProcessingDates
File2=$DIR/${Name}ErrorFile
File3=$DIR/${Name}ReportFile
DATE=`date +"%d/%m/%Y`
JDATE=`date +"%j`
Jdate=`grep UHL1 $File | awk '{ x=substr($2,1,5); print x }'`
echo $Jdate
Jday=`echo $Jdate | awk '{ x=substr($1,3,3); print x }'`
echo $Jday
##############################################################################
# Test for previous run of $Name file to be processed
#
##############################################################################
> $File2
Num=` grep -c $Jdate $File1`
echo $Num
if [ $Num -ge 1 ]
then
echo File Allready Processed > $File2
exit 1
else
echo OK
echo " $Jdate" >> $File1
fi
##############################################################################
# Calculate processing date using maestro datecalc
#
##############################################################################
Num1=`expr $JDATE - $Jday`
echo $Num1
Pro_Date=`datecalc today - $Num1 days pic dd/mm/yyyy`
echo $Pro_Date
|
|
|
|
|