1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| data test;
infile datalines dsd dlm='|' missover;
input
Id :$2. Note1 :8. date1 :anydtdte10.
Note2 :8. date2 :anydtdte10. Note3 :8. date3 :anydtdte10. Nbre :8.;
format da: date9. ;
datalines;
x1|8|01/10/2008|10|01/09/2009|15|01/03/2010|3
x2|12|01/08/2008|8|01/07/2009|||2
x3|11|01/03/2008|7|01/04/2009|12|01/12/2010|3
x4|14|01/11/2009|14|01/10/2010|||2
;run;
proc format ;
value li
1= La note reste au dessus de la moyenne
2= La note passe en dessous de la moyenne
3= La note passe au dessus de la moyenne
4= La note reste en dessous de la moyenne
;run;
data test2;
set test;
length first last 8. ;
array no (*) note: ;
first=no(1);
do i = 1 to dim(no);
if no(i) ne . then last=no(i);
end;
if first in (10,11,12,13,14,15,16,17,18,19,20) and last in (10,11,12,13,14,15,16,17,18,19,20) then comment = 1;
if first in (10,11,12,13,14,15,16,17,18,19,20) and last in (0,1,2,3,4,5,6,7,8,9) then comment = 2;
if first in (0,1,2,3,4,5,6,7,8,9) and last in (10,11,12,13,14,15,16,17,18,19,20) then comment = 3;
if first in (0,1,2,3,4,5,6,7,8,9) and last in (0,1,2,3,4,5,6,7,8,9) then comment = 4;
do j=2 to dim(no)-1;
moy = MEAN(of no(j) );
end;
drop i ;
format comment li. ;
run; |
Partager