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.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

From SAS Users blog
Want more? Visit our blog for more articles like these.
5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

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