DATA Step, Macro, Functions and more

Data null Question

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Data null Question

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 


Accepted Solutions
Solution
‎09-25-2015 06:23 AM
Super User
Posts: 19,789

Re: Data null Question

Posted in reply to geronimo44
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


All Replies
Super User
Posts: 5,427

Re: Data null Question

Posted in reply to geronimo44

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
Trusted Advisor
Posts: 1,913

Re: Data null Question

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

Occasional Contributor
Posts: 5

Re: Data null Question

Posted in reply to PaigeMiller

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. 

Solution
‎09-25-2015 06:23 AM
Super User
Posts: 19,789

Re: Data null Question

Posted in reply to geronimo44
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.
🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

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