Bonsoir Cher internautes ,
j'ai créer une macro toute simple mais je n'arrive pas a obtenir ce que je recherche!
Si l'un de vous pourriez me corriger , ce serait fort sympatique
Voici la macro :
la variable volume est bien appliquée mais pas celle de mag .
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 %macro ensmag ( mag, volumes) ; data malib.irism ; set malib.iris ; txpenetration = clients / menages ; if txpenetration<0 then txpenetration=0 ; where &mag ; run; proc sort data = malib.iris2 ; by descending txpenetration; run; data malib.irism; set malib.irism ; retain cumul 0; cumul= cumul + menages; run; data malib.irism; set malib.irism ; where cumul <= &volumes ; run; %mend ; %ensmag ( mag="B" , volumes=36420) ;
Il ne se preoccupe pas de selectionner Mag avec la modalité B.
Merci par avance
Partager