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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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