Previous Page | Next Page

Functions and CALL Routines

CALL SLEEP Routine



For a specified period of time, suspends the execution of a program that invokes this CALL routine.
Category: Special
See: CALL SLEEP Routine under UNIX z/OS

Syntax
Arguments
Details
Examples
Example 1: Suspending Execution for a Specified Period of Time
Example 2: Suspending Execution Based on a Calculation of Sleep Time
See Also

Syntax

CALL SLEEP(n<, unit>)

Arguments

n

is a numeric constant that specifies the number of units of time for which you want to suspend execution of a program.

Range: n [ge] 0
unit

specifies the unit of time, as a power of 10, which is applied to n. For example, 1 corresponds to a second, and .001 corresponds to a millisecond.

Default: .001

Details

The CALL SLEEP routine suspends the execution of a program that invokes this call routine for a period of time that you specify. The program can be a DATA step, macro, IML, SCL, or anything that can invoke a call routine. The maximum sleep period for the CALL SLEEP routine is 46 days.


Examples


Example 1: Suspending Execution for a Specified Period of Time

The following example tells SAS to suspend the execution of the DATA step PAYROLL for 1 minute and 10 seconds:

data payroll;
   call sleep(7000,.01);
   ...more SAS statements...
run;


Example 2: Suspending Execution Based on a Calculation of Sleep Time

The following example tells SAS to suspend the execution of the DATA step BUDGET until March 1, 2004, at 3:00 AM. SAS calculates the length of the suspension based on the target date and the date and time that the DATA step begins to execute.

data budget;
   sleeptime='01mar2004:03:00'dt-datetime();
   call sleep(sleeptime,1);
   ...more SAS statements...;
run;


See Also

Functions:

SLEEP Function

Previous Page | Next Page | Top of Page