BookmarkSubscribeRSS Feed
gtucke1
Fluorite | Level 6

I have a dataset and is interested in only do analysis among female participants. How do I save this new dataset? I want to be able to send the trimmed dataset to another researcher so that they just open the new dataset.  Do I do a new libname? 

 

Thank you for the help. I am definitely a newbie so pardon my simplistic question. 

 

 

1 REPLY 1
PaigeMiller
Diamond | Level 26

You don't need a new libname, you can use any libname that you have already created.

 

Let's suppose you already have a libname named FRED, and you want to create this new data set inside libname FRED. Then something like this works, it creates a new data set named FEMALES_ONLY in libname FRED. (That's what the two-part name indicates, FRED.FEMALES_ONLY is the data set FEMALES_ONLY in libname FRED). For example:

 

data fred.females_only;
     set yourdatasetname;
     where gender='F';
run;

 

 

But even the above is not necessary, assuming that your colleague has read access to your existing libname. you can send this person the LIBNAME statement, placing ACCESS=READONLY at the end, and then this person can do whatever he or she or it wants, you shouldn't have to subset the data for this person.

 

libname FRED "yourfoldername" access=readonly;

 

--
Paige Miller

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 431 views
  • 0 likes
  • 2 in conversation