Hi all,
I have a dataset with 5 observations;
OBSERVATION
F
T
J
D
D
I want to spread the observations like this (so the first obervation has to be there for the first five days, the second observations has to be there for the next five days, (from day 6 to 10,... and so on);
I want to come up with the following dataset;
DAY,OBSERVATION
1,F
2,F
3,F
4,F
5,F
6,T
7,T
8,T
9,T
10,T
11,J
12,J
13,J
14,J
15,J
16,D
17,D
18,D
19,D
20,D
21,D
22,D
23,D
24,D
25,D
I have programmed this in the following way,
options nomprint nosymbolgen nomlogic;
%macro result;
data %do i=1 %to 5;
Data VECTOR_PRE (drop=obsnum);
obsnum=&i;
set VECTOR_ point=obsnum;
output;
stop;
run;
DATA OUTPUT&i;
SET VECTOR_PRE;
day=0;
do day=&i*(30)-30+1 to &i*(30);
output;
end;
run;
%end;
data sasuser.want;
set output: indsname=dsn;
drop dsn;
run;
%mend ;
%result
Is there a way to do this in a datastep, so without using a macro?
Kind regards,
Stefaan
Message was edited by: OzoneX15