BookmarkSubscribeRSS Feed
Markanti
Calcite | Level 5
  1. Create a new data set called “half” from “main”.  Reduce this dataset by ½ using a random number generator for the uniform distribution (ranuni) with the seed of 100.

Unfinished Code

*Lab 8 – Problem 5;

data

run;

I run the code like this ? is it correct?

*Lab 8 – Problem 5;

data lab.half;
set lab.main;
random = ranuni(0);
if ranuni(100) < 0.5 then output;
run;

proc print data=lab.half;
run;

1 REPLY 1
Kurt_Bremser
Super User

See Maxim 4. Run the code in your environment and study the results (number of 0bservations, content of variables).

The creation of a new variable was not asked.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 868 views
  • 0 likes
  • 2 in conversation