2 Replies Latest reply: Jan 7, 2013 5:44 AM by Ankit Joshi RSS

    Issue Regarding Sleep Function

      Dear All,

       

      I am facing a issue while I am using Sleep Function in the Script.

       

      If floor(today())=floor(WeekEnd(Today())) Then 

           SLEEP 5400*1000

      ENDIF

       

      ODBC CONNECT TO ***************************************************************************** ;

       

      My reload starts at 5:45 AM that means when it will find Sunday it will sleep for 1 Hr and 30 Mins that means it will wake up at 7:15 AM but ENDIF executed at 6:45 AM that is exactly after 1 Hr. And i am observing this from past two weeks. earlier i was using 3600*1000 so in that condition it was fine but in current condition ENDIF should execute at 7:15 AM but it is not

       

      1/6/2013 5:45:01 AM:      Execution started.

      1/6/2013 5:45:01 AM: 0019  If floor(today())=floor(WeekEnd(Today())) Then

      1/6/2013 5:45:01 AM: 0020    SLEEP 5400*1000

      1/6/2013 6:45:01 AM: 0022  ENDIF

      1/6/2013 6:45:01 AM: 0024  ODBC CONNECT**

       

       

      Please help ............

       

      Regrads,

      Ankit Joshi

        • Re: Issue Regarding Sleep Function
          Dave Riley

          1 hour appears to be the maximum period for Sleep ...

           

          "The sleep statement pauses script execution for n milliseconds, where n is a positive integer no larger than 3600000 (i.e. 1 hour). The value may be an expression."

           

          Try using two sleep commands 3600*1000 then 1800*1000.

           

          flipside

            • Re: Issue Regarding Sleep Function

              Dear Flipside,

               

              Thank you so much for your response. Initially I checked maximum value of Sleep that I found 24 days so I ignored the thought regarding 1 hour limit. After posting issue here I just tried the same logic what you have given n that worked fine.

               

              Thanks.

               

              Regards,

              Ankit Joshi