Hi,
I have a query to write to output datasets.
If I =1 then I write to output dataset i= first 1 2 3 4 datavalues.
again if i=1 then I write second set of i 1234 datavalues to another
output dataset not previous 1 2 34.
and repeat the process create outputdatasets.
first outputdataset: 1 . . 0.00042
2 189.55 280.12 0.00031
3 189.8 280.17 0.00035
4 189.78 280.16 0.00018
second outputdataset:
1 280.04 0.00042
2 280.12 0.00031
3 189.55 280.17 0.00035
4 189.8 280.16 0.00018
obviously third and fourth and so. on
can you please help me to write this code.
data new;
infile cards missover;
input I X2 X1 Y;
cards;
1 . . 0.00042
2 189.55 280.12 0.00031
3 189.8 280.17 0.00035
4 189.78 280.16 0.00018
1 280.04 0.00042
2 280.12 0.00031
3 189.55 280.17 0.00035
4 189.8 280.16 0.00018
1 280.04 0.00042
2 280.12 0.00031
3 280.17 0.00035
4 189.55 280.16 0.00018
1 189.56 0.00042
2 189.55 0.00031
3 189.8 280.12 0.00035
4 189.78 280.17 0.00018
1 189.78 280.16 0.00042
2 189.56 280.04 0.00031
3 189.55 280.12 0.00035
4 189.8 280.17 0.00018
1 189.8 280.16 0.00042
2 189.78 280.04 0.00031
3 189.56 280.12 0.00035
4 189.55 280.17 0.00018
1 189.56 0.00042
2 189.55 0.00031
3 189.8 0.00035
4 189.78 280.12 0.00018
1 189.78 280.17 0.00042
2 189.56 280.16 0.00031
3 189.55 280.04 0.00035
4 189.8 280.12 0.00018
1 189.8 280.17 0.00042
2 189.78 280.16 0.00031
3 189.56 280.04 0.00035
4 189.55 280.12 0.00018
1 189.56 280.04 0.00042
2 698.78 280.12 0.00031
3 699.14 280.17 0.00035
4 699.39 280.16 0.00018
1 189.78 280.04 0.00042
2 189.56 280.12 0.00031
3 698.78 280.17 0.00035
4 699.14 280.16 0.00018
1 189.8 280.04 0.00042
2 189.78 280.12 0.00031
3 189.56 280.17 0.00035
4 698.78 280.16 0.00018
1 699.42 280.16 0.00042
2 698.78 280.04 0.00031
3 699.14 280.12 0.00035
4 699.39 280.17 0.00018
1 699.39 280.16 0.00042
2 699.42 280.04 0.00031
3 698.78 280.12 0.00035
4 699.14 280.17 0.00018
1 699.14 280.16 0.00042
2 699.39 280.04 0.00031
3 699.42 280.12 0.00035
4 698.78 280.17 0.00018
1 699.42 280.17 0.00042
2 698.78 280.16 0.00031
3 699.14 280.04 0.00035
4 699.39 280.12 0.00018
1 699.39 280.17 0.00042
2 699.42 280.16 0.00031
3 698.78 280.04 0.00035
4 699.14 280.12 0.00018
1 699.14 280.17 0.00042
2 699.39 280.16 0.00031
3 699.42 280.04 0.00035
4 698.78 280.12 0.00018
1 699.42 280.04 0.00042
2 698.78 189.55 0.00031
3 699.14 189.8 0.00035
4 699.39 189.78 0.00018
1 699.39 189.56 0.00042
2 699.42 189.55 0.00031
3 698.78 189.8 0.00035
4 699.14 189.78 0.00018
1 699.14 189.56 0.00042
2 699.39 189.55 0.00031
3 699.42 189.8 0.00035
4 698.78 189.78 0.00018
1 699.42 280.16 0.00042
2 698.78 280.04 0.00031
3 699.14 189.55 0.00035
4 699.39 189.8 0.00018
1 699.39 189.78 0.00042
2 699.42 189.56 0.00031
3 698.78 189.55 0.00035
4 699.14 189.8 0.00018
1 699.14 189.78 0.00042
2 699.39 189.56 0.00031
3 699.42 189.55 0.00035
4 698.78 189.8 0.00018
1 699.42 280.17 0.00042
2 698.78 280.16 0.00031
3 699.14 280.04 0.00035
4 699.39 189.55 0.00018
1 699.39 189.8 0.00042
2 699.42 189.78 0.00031
3 698.78 189.56 0.00035
4 699.14 189.55 0.00018
1 699.14 189.8 0.00042
2 699.39 189.78 0.00031
3 699.42 189.56 0.00035
4 698.78 189.55 0.00018
;
run;
Hope SAS guys will finish so easy..
Teja
|
|
0
|
|
|
|
Reply
|
teja97 (1)
|
11/14/2007 11:34:33 AM |
|
On Nov 14, 6:34 am, "tej...@gmail.com" <tej...@gmail.com> wrote:
> Hi,
> I have a query to write to output datasets.
> If I =1 then I write to output dataset i= first 1 2 3 4 datavalues.
> again if i=1 then I write second set of i 1234 datavalues to another
> output dataset not previous 1 2 34.
> and repeat the process create outputdatasets.
>
> first outputdataset: 1 . . 0.00042
> 2 189.55 280.12 0.00031
> 3 189.8 280.17 0.00035
> 4 189.78 280.16 0.00018
>
> second outputdataset:
>
> 1 280.04 0.00042
> 2 280.12 0.00031
> 3 189.55 280.17 0.00035
> 4 189.8 280.16 0.00018
>
> obviously third and fourth and so. on
>
> can you please help me to write this code.
>
> data new;
> infile cards missover;
> input I X2 X1 Y;
> cards;
> 1 . . 0.00042
> 2 189.55 280.12 0.00031
> 3 189.8 280.17 0.00035
> 4 189.78 280.16 0.00018
> 1 280.04 0.00042
> 2 280.12 0.00031
> 3 189.55 280.17 0.00035
> 4 189.8 280.16 0.00018
> 1 280.04 0.00042
> 2 280.12 0.00031
> 3 280.17 0.00035
> 4 189.55 280.16 0.00018
> 1 189.56 0.00042
> 2 189.55 0.00031
> 3 189.8 280.12 0.00035
> 4 189.78 280.17 0.00018
> 1 189.78 280.16 0.00042
> 2 189.56 280.04 0.00031
> 3 189.55 280.12 0.00035
> 4 189.8 280.17 0.00018
> 1 189.8 280.16 0.00042
> 2 189.78 280.04 0.00031
> 3 189.56 280.12 0.00035
> 4 189.55 280.17 0.00018
> 1 189.56 0.00042
> 2 189.55 0.00031
> 3 189.8 0.00035
> 4 189.78 280.12 0.00018
> 1 189.78 280.17 0.00042
> 2 189.56 280.16 0.00031
> 3 189.55 280.04 0.00035
> 4 189.8 280.12 0.00018
> 1 189.8 280.17 0.00042
> 2 189.78 280.16 0.00031
> 3 189.56 280.04 0.00035
> 4 189.55 280.12 0.00018
> 1 189.56 280.04 0.00042
> 2 698.78 280.12 0.00031
> 3 699.14 280.17 0.00035
> 4 699.39 280.16 0.00018
> 1 189.78 280.04 0.00042
> 2 189.56 280.12 0.00031
> 3 698.78 280.17 0.00035
> 4 699.14 280.16 0.00018
> 1 189.8 280.04 0.00042
> 2 189.78 280.12 0.00031
> 3 189.56 280.17 0.00035
> 4 698.78 280.16 0.00018
> 1 699.42 280.16 0.00042
> 2 698.78 280.04 0.00031
> 3 699.14 280.12 0.00035
> 4 699.39 280.17 0.00018
> 1 699.39 280.16 0.00042
> 2 699.42 280.04 0.00031
> 3 698.78 280.12 0.00035
> 4 699.14 280.17 0.00018
> 1 699.14 280.16 0.00042
> 2 699.39 280.04 0.00031
> 3 699.42 280.12 0.00035
> 4 698.78 280.17 0.00018
> 1 699.42 280.17 0.00042
> 2 698.78 280.16 0.00031
> 3 699.14 280.04 0.00035
> 4 699.39 280.12 0.00018
> 1 699.39 280.17 0.00042
> 2 699.42 280.16 0.00031
> 3 698.78 280.04 0.00035
> 4 699.14 280.12 0.00018
> 1 699.14 280.17 0.00042
> 2 699.39 280.16 0.00031
> 3 699.42 280.04 0.00035
> 4 698.78 280.12 0.00018
> 1 699.42 280.04 0.00042
> 2 698.78 189.55 0.00031
> 3 699.14 189.8 0.00035
> 4 699.39 189.78 0.00018
> 1 699.39 189.56 0.00042
> 2 699.42 189.55 0.00031
> 3 698.78 189.8 0.00035
> 4 699.14 189.78 0.00018
> 1 699.14 189.56 0.00042
> 2 699.39 189.55 0.00031
> 3 699.42 189.8 0.00035
> 4 698.78 189.78 0.00018
> 1 699.42 280.16 0.00042
> 2 698.78 280.04 0.00031
> 3 699.14 189.55 0.00035
> 4 699.39 189.8 0.00018
> 1 699.39 189.78 0.00042
> 2 699.42 189.56 0.00031
> 3 698.78 189.55 0.00035
> 4 699.14 189.8 0.00018
> 1 699.14 189.78 0.00042
> 2 699.39 189.56 0.00031
> 3 699.42 189.55 0.00035
> 4 698.78 189.8 0.00018
> 1 699.42 280.17 0.00042
> 2 698.78 280.16 0.00031
> 3 699.14 280.04 0.00035
> 4 699.39 189.55 0.00018
> 1 699.39 189.8 0.00042
> 2 699.42 189.78 0.00031
> 3 698.78 189.56 0.00035
> 4 699.14 189.55 0.00018
> 1 699.14 189.8 0.00042
> 2 699.39 189.78 0.00031
> 3 699.42 189.56 0.00035
> 4 698.78 189.55 0.00018
> ;
> run;
>
> Hope SAS guys will finish so easy..
> Teja
It's usually not a good idea to do that. It's better to just assign a
group number to each series of 4 observations, then use that as a BY
variable.
|
|
0
|
|
|
|
Reply
|
nospam1405 (4716)
|
11/19/2007 10:20:55 PM
|
|