BookmarkSubscribeRSS Feed
Pabster
Obsidian | Level 7

Hi everyone,

 

I' ve posting quite a bit about this to try and get around the problem without succes.

Here is part of the data set I have to work on 

OSTTII.png

The companies that have a DLRSN number are Inactive, those without it are Active.

What I need to do is:
-Through the use of the Uniform Function , give each company a random number between 0-1 (hence the uniform)
-Afterwards use that number to select a unique Active company for each possible Inactive company.
an Active company Cannot be used 2 for analysis purpose

my final data set should look something like this :

DATADATE FYEAR DLRSN CONM DLDTE COSTAT SICH

03/12/1992 1989            .          A                        0         112

03/12/1993 1989             02      B        1990        1         112

03/12/1994 1990           .           D                        0         333

03/12/1992 1990            03        F        1992       1         333

03/12/1993 1994          .             J                         0        445

03/12/1994 1994          03          L         1996      1          445

03/12/1998 1998          .             I                        0          001

03/12/1998 1998          02         Z         2000       1          001


*Update*
I realized that by MERGING my data set and not doing a SET merge, I obtained the following data:

osti2.png

This are all Active companies that correspond to my Inactive ones (that you can see in the 1st picture). How can I create a random uniform function that will give them random values between 0-1 so I can pick some of them for further analysis

Hope its clear and you guys can help

1 REPLY 1
Reeza
Super User
Have you looked into PROC SURVEYSELECT to pick random samples?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 501 views
  • 0 likes
  • 2 in conversation