Data input through Do Loop

Today I had to enter a set of 64 Y variables in a 4*4*4 table with A, B and Block each having 4 levels, here is how I did it.

 

data split;
do A=1 to 4;
do B=1 to 4;
do Block= 1 to 4;
input Y;
output;
end;
end;
end;
cards;
42.9
41.6
28.9
30.8
53.8
58.5
43.9
46.3
49.5
53.8
40.7
39.4
44.4
41.8
28.3
34.7
53.3
69.6
45.4
35.1
57.6
69.6
42.4
51.9
59.8
65.8
41.4
45.4
64.1
57.4
44.1
51.6
62.3
58.5
44.6
50.3
63.4
50.4
45
46.7
64.5
46.1
62.6
50.3
63.6
56.1
52.7
51.8
75.4
65.6
54
52.7
70.3
67.3
57.6
58.5
68.8
65.3
45.6
51
71.6
69.4
56.6
47.4
;
run;

*showing only first five rows;

proc print data=oat1 (obs=5);
run;

Obs A B Block Y
1 1 1 1 42.9
2 1 1 2 41.6
3 1 1 3 28.9
4 1 1 4 30.8
5 1 2 1 53.8

0 comments: