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?

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

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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