BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
alexlor
Fluorite | Level 6

Hello,

 

The Wakeup function seems unrecognized. The wakeup function allows you to specify the date and time to delay the execution.

 

Indeed in my Windows machine it works but not working on my Linux Machine with SAS 9.4.

 

DATA _null_;

rc=wakeup(DHMS(TODAY(),3,7,30));

RUN;

 

ERROR 68-185: The function WAKEUP is unknown, or cannot be accessed.

 

Any ideas?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

@Quentin you are right, of course. The proper way to use the sleep function is this:

%let sleep_until='10jul2017:14:30:00'dt;

data _null_;
sleeptime = &sleep_until - time();
slept = sleep(sleeptime,1);
run;

as this forces sleep() to use seconds as the unit across all platforms.

Or

%let sleep_until='10jul2017:14:30:00'dt;

data _null_;
sleeptime = &sleep_until - time();
call sleep(sleeptime,1);
run;

View solution in original post

3 REPLIES 3
Kurt_Bremser
Super User

WAKEUP is a Windows-only feature of SAS.

You won't find it in the generic SAS documentation of functions and call routines.

 

To achieve something similar on any other platform, do this:

%let sleep_until='10jul2017:14:30:00'dt;

data _null_;
sleeptime = &sleep_until - time();
slept = sleep(sleeptime);
run;

 

 

 

Quentin
Super User
On Linux the default unit for sleep is miliseconds rather than seconds. So could adjust @Kurt_Bremser's calculation to be:
sleeptime = (&sleep_until - time()) *1000 ;
The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
Kurt_Bremser
Super User

@Quentin you are right, of course. The proper way to use the sleep function is this:

%let sleep_until='10jul2017:14:30:00'dt;

data _null_;
sleeptime = &sleep_until - time();
slept = sleep(sleeptime,1);
run;

as this forces sleep() to use seconds as the unit across all platforms.

Or

%let sleep_until='10jul2017:14:30:00'dt;

data _null_;
sleeptime = &sleep_until - time();
call sleep(sleeptime,1);
run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2176 views
  • 4 likes
  • 3 in conversation