Date: Sat, 29 Mar 2008 09:19:08 -0500
Reply-To: "data _null_," <datanull@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "data _null_," <datanull@GMAIL.COM>
Subject: Re: Create 2 datasets with one dataset
In-Reply-To: <bc11333d-e5be-44ac-98ed-d1839283e128@d62g2000hsf.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
They say two heads are better than one, but that is not usually the
case for SAS data sets. One data set is usually better than two,
especially when they contain the same data. Perhaps you would like a
view to the data with a variable CUT(1,2) you could use WHERE to
subset if desired or create a data set by sorting on CUT and use BY
group processing.
data cutsV / view=cutsV;
length cut 8;
set tocut;
cut = ifn(x1 eq 0,1,2);
run;
proc ...
where cut eq 1;
On Sat, Mar 29, 2008 at 9:05 AM, ash007 <RamsamyAshley@gmail.com> wrote:
> Hello,
>
> I have a dataset and I would like to create with this dataset, two
> datasets.
>
> example : I have the dataset 'TOCUT'
>
> DATA TOCUT;
> INPUT X1 X2 X3 X4;
> CARDS;
> 2 5 5 1161
> 0 6 3 1336
> 1 1 5 1499
> 0 5 5 1161
> 35 6 3 1336
> 82 1 5 1499
> 0 5 5 1161
> 35 6 3 1336
> 0 1 5 1499
> ;RUN;
>
> for X1 = 0, I would like the dataset '' CUT1" :
>
> 0 6 3 1336
> 0 5 5 1161
> 0 5 5 1161
> 0 1 5 1499
>
> pour X1 non equal 0, I would like the dataset '' CUT2" :
>
> 2 5 5 1161
> 1 1 5 1499
> 35 6 3 1336
> 82 1 5 1499
> 35 6 3 1336
>
> Thank for your help.
>
|