Date: Fri, 27 Jul 2007 16:20:39 +1000
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: David Johnson <d@DKVJ.BIZ>
Subject: Re: Divide datasets into sub-datasets based on Variable Value
Content-Type: text/plain; charset="iso-8859-1"
Why do you want to divide the data set into three? If the data are ordered
by TEST, then you can use By-Group processing in just about every procedure,
and Where clause processing in every procedure to select any one or more of
the test values. Splitting it into three just triples the number of tables
you have to look after. What's more, if the table is really big, setting an
index on the table using the TEST value will give you performance benefits
in reading and analysing the data.
But, if you insist: look at specifying more than one output table on the
Data statement, and then read the source data. By testing the value of TEST
you can then specify which one of the output tables should receive the
record with a simple IF statement.
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of Mark
Sent: Friday, 27 July 2007 3:21 PM
Subject: Divide datasets into sub-datasets based on Variable Value
I have a SAS programming question.Wondering if anyone has some idea.
I have a dataset with two variables: Test, Level. The variable Test
can have multiple values. For instance, in below example, variable
Test has 3 values(A,B,C).
Test has an associated Level value(numeric).
I need to divide the dataset into smaller datasets: each corresponds
to every sub-test. For above example, need to separate into three sub
I don't know how many different Test value in the dataset.
Your help is appreciated.