BookmarkSubscribeRSS Feed
bayoote
Calcite | Level 5

Hi All,

 

Attached is part of my datasets.  I want to split the dataset into multiple datasets based on the Group, Product, Condition.

Any suggestions? Thanks!

5 REPLIES 5
Reeza
Super User

Why? This isn't recommend usually because there are multiple ways to process data by groups without splitting them up or ways to export the data without first having to create multiple data sets. So explaining what your end goal is will help us provide a better solution.

bayoote
Calcite | Level 5
Hi, Thanks for your reply. Since I want to do the interpolation for each small group.That's why I need to split the dataset.
PaigeMiller
Diamond | Level 26

You do whatever analysis you are planning using the BY statement. Leave everything in one data set.

--
Paige Miller
Reeza
Super User

Yeah, you don't need to do that in SAS. You can use BY to treat each group separately. For example, this will produce a regression model for each origin, entirely separately.

 

proc sort data=sashelp.cars out=cars;
by origin;
run;

proc reg data=cars;
by origin;
model Mpg_city = weight cylinders msrp;
run;


@bayoote wrote:
Hi, Thanks for your reply. Since I want to do the interpolation for each small group.That's why I need to split the dataset.

 

PeterClemmensen
Tourmaline | Level 20

Is there a good reason why you want to do this? Generally, it is not advisable.

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 16. 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
  • 5 replies
  • 541 views
  • 2 likes
  • 4 in conversation