Chapter Contents

Previous

Next
WAKEUP

WAKEUP



Specifies the time a SAS DATA step begins execution

Windows specifics: all


Syntax
Details
Examples
Example 1: Delaying Program Execution until a Specified Date or Time
Example 2: Delaying Program Execution until a Specified Time Period after Midnight
Example 3: Using a Variable as an Argument to the WAKEUP Function

Syntax

WAKEUP(until-when)

until-when
specifies the time when the WAKEUP function will be executed.


Details

Use the WAKEUP function to specify the time a DATA step begins to execute. The return value is the number of seconds slept.

The until-when argument can be a SAS datetime value, a SAS time value, or a numeric constant, as explained in the following list:

Negative values for the until-when argument are allowed, but missing values are not. The maximum sleep period for the WAKEUP function is approximately 46 days.

When you submit a program that calls the WAKEUP function, a pop-up window appears telling you when the SAS System is going to wake up. Your SAS session remains inactive until the waiting period is over. If you want to cancel the call to the WAKEUP function, use the CTRL BREAK attention sequence.

You should use a null DATA step to call the WAKEUP function; follow this DATA step with the rest of the SAS program. Using the WAKEUP function in this manner enables you to use the CTRL+BREAK attention sequence to interrupt the waiting period and continue with the execution of the rest of your SAS program.


Examples

Example 1: Delaying Program Execution until a Specified Date or Time

The code in this example tells the SAS System to delay execution of the program until 1:00 p.m. on January 1, 1999:

data _null_;
   slept=wakeup('01JAN1999:13:00:00'dt);
run;
data compare;
   /* ...more data lines */
run;

The following example tells the SAS System to delay execution of the program until 10:00 p.m.:

data _null_;
   slept=wakeup("22:00:00"t);
run;
data compare;
   /* ...more data lines */
run;

Example 2: Delaying Program Execution until a Specified Time Period after Midnight

The following example tells the SAS System to delay execution of the program until 35 seconds after the next occurring midnight:

data _null_;
   slept=wakeup(35);
run;
data compare;
   /* ...more data lines */
run;

Example 3: Using a Variable as an Argument to the WAKEUP Function

This example illustrates using a variable as the argument of the WAKEUP function:

data _null_;
   input x;
   slept=wakeup(x);
   cards;
1000
;
data compare;
   input article1 $ article2 $ rating;
   /* ...more data lines */
run;

Because the instream data indicate that the value of X is 1000, the WAKEUP function sleeps for 1,000 seconds past midnight.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.