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

Hi community, I have come through some kind of excercises and I would much appreciate your ideas. I have also done my research in SAS documentation but I still have some questions on the following: 

 

What would this code do and what results could possibly return? 

 

data _null_;

x = sleep(2);

run;

 

 Thank you 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
data _null_ tells SAS not to create a data set while executing this particular data step. There is no specific connection to the sleep function. You use a Data _null_ statement in this situation to pass commands to the system that you only want to execute once.

Sleep tells it to pause between commands, usually as a safety precaution to wait for another process to finish.

View solution in original post

4 REPLIES 4
LinusH
Tourmaline | Level 20

Search support.sas.com for data _null_. It should give you plenty of hits.

And secondly, you have a piece of code. Please don't ask what it does - try it yourself and observe...

Data never sleeps
PaigeMiller
Diamond | Level 26

Also, the HELP documentation for the SLEEP command is extremely clear.

--
Paige Miller
geronimo44
Fluorite | Level 6

Thanks for the replies. Apparently I am not able to run the code cause my academic license expired and that's why I threw it in the community board. I also am aware of the Sleep functionality but since I am unable to run the code, I can't see how teh data_null connects to the sleep function.

 

In any case thank you for your consideration. 

Reeza
Super User
data _null_ tells SAS not to create a data set while executing this particular data step. There is no specific connection to the sleep function. You use a Data _null_ statement in this situation to pass commands to the system that you only want to execute once.

Sleep tells it to pause between commands, usually as a safety precaution to wait for another process to finish.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1242 views
  • 1 like
  • 4 in conversation