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 45 46 47 48 49 50 51 52 53 54
| /* Liste des participants au tirage au sort */
DATA DM ;
INPUT NUMERO 1-2 NOM $ 4-18 PRENOM $ 20-28 ;
CARDS ;
01 AUBAGNAC Benoît
02 AUCHOIX Paul
03 BEBEK Virgnie
04 BLANC François
05 DA CONCEICAO Romain
06 ELBAZ Samantha
07 ELEORE Anaďs
08 JACQUES-ORANGER Anne
09 JANNEAU Carine
10 JOSIEN Florence
11 PETRE Philippe
12 ROUDAUT Géraldine
13 SAHEL Sophie
14 SISSOKO Sambou
15 TOUIAR Sonia
16 VO PHUOC LAM Mélodie
;
RUN ;
/* Macro-programme du tirage aléatoire */
%macro Tirage(libref=,entree=,sortie=,nb=);
data &libref..&sortie (drop=i j count);
count=0;
array obsnum(&nb) _temporary_;
do i=1 to &nb;
redo:
select=ceil(ranuni(0)*n);
set &libref..&entree point=select nobs=n;
do j=1 to count;
if obsnum(j)=select then goto redo;
end;
position=select;
count=count+1;
obsnum(count)=select;
output;
end;
stop;
set &libref..&entree;
run;
%mend Tirage ;
/* Lancement du tirage au sort d'un des seize participants */
%Tirage(libref=work, entree=DM, sortie=GAGNANT, nb=1) ; |
Partager