Home » Infrastructure » Unix » Date Problem in Script
Date Problem in Script [message #334860] Fri, 18 July 2008 07:12 Go to next message
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
Re: Date Problem in Script [message #334869 is a reply to message #334860] Fri, 18 July 2008 08:20 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
This question has no relation with Oracle.
Please find a more appropriate forum.
The topic is locked.

Regards
Michel
Re: Date Problem in Script [message #334870 is a reply to message #334860] Fri, 18 July 2008 08:22 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
The problem & solution do not involve Oracle.
Previous Topic: ftp the pgp encripted file
Next Topic: From FTP Site get the latest file
Goto Forum:
  


Current Time: Mon Dec 02 18:48:45 CST 2024