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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 4 replies
  • 954 views
  • 1 like
  • 4 in conversation