ReBonjour à tout le monde!

Je me permets ici de vous présenter un défi somme toute simple pour vous, je le pense; il serait utile de fluidifier le code dans la création d'une variable:

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
23
24
25
26
27
28
29
30
 
data stock;
set stock;
if CANAL_APPORT_SOURCE='AUBQ' then CAT='BUP';
run;
 
data stock;
set stock;
if CANAL_APPORT_SOURCE='CA' then CAT='BUP';
run;
 
data stock;
set stock;
if CANAL_APPORT_SOURCE='LCL' then CAT='BUP';
run;
 
data stock;
set stock;
if CANAL_APPORT_SOURCE='APPO' then CAT='BUP';
run;
 
data stock;
set stock;
if CANAL_APPORT_SOURCE='DIRE' then CAT='NON BUP';
run;
 
data stock;
set stock;
if CANAL_APPORT_SOURCE='CCF' then CAT='NON BUP';
run;
Il y a donc six catégories à regrouper sous le nom d'une nouvelle variable avec deux variantes: BUP/NON BUP

Je vous en remercie!

REMI