Bonjour à tous,

j'ai 1 problème très simple aujourd'hui. Je fais 1 ods tagsets.excelxp sur sas pour produire 1 tableau excel. Je souhaite juste rajouter un code couleur sur la ligne en fonction de la valeur d'une variable, que je declare en marco variable au début. Pas de problème jusqu'ici.
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
31
32
33
34
35
36
37
 
 
proc sql;
select evol_moyenne into : palier_evol
from selection_total
;
quit;
 
ods _all_ close;
ods tagsets.excelxp 
			file="\\192.179\datamining\RESIL.xls" 
			style=monstyle
			options(embedded_titles="yes" 
				 	embedded_footnotes="no"
					sheet_name="&mois_terme._&annee."
							autofilter='all' 
							absolute_column_width='20,10,10,10,15'
							sheet_interval='none' );
title "Détail par Marché / Polemarché";
proc report data=selection_final nowd ; 
columns Marche PoleMarche nb_contrat_au_terme Somme_prime_avant Somme_prime_apres evol_moyenne 
 Resilie_1mois_et_15j proportion_resilie_1mois_15j Somme_prime_avant_resil Somme_prime_apres_resil evol_moyenne_resil;
define Marche / display "Marché"  ;
define PoleMarche / display "Pôle de Marché"  ;
define nb_contrat_au_terme / display "Nombre de contrat passé au terme"  ;
define Somme_prime_avant / display "Prime avant en K€"  ;
define Somme_prime_apres / display "Prime après en K€"  ;
define evol_moyenne / display "Evolution moyenne de la prime"  ;
compute evol_moyenne;
if evol_moyenne>&palier_evol. then call define (_ROW_,‘style’,‘style=[background=lightblue foreground=red ]);
endcomp;
define Resilie_1mois_et_15j / display "Nombre de contrat pour ce terme résilié sous délai 45j";
define proportion_resilie_1mois_15j / display "Proportion resilie / nombre de contrat total"  ;
define Somme_prime_avant_resil / display "Prime avant résilié en K€"  ;
define Somme_prime_apres_resil / display "Prime après résilié en K€"  ;
define evol_moyenne_resil / display "Evolution moyenne resilié"  ;
run;


SAS plante et me sort ça :

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 
title "Détail par Marché / Polemarché";
76         proc report data=selection_final nowd ;
77         columns Marche PoleMarche nb_contrat_au_terme Somme_prime_avant Somme_prime_apres evol_moyenne
78          Resilie_1mois_et_15j proportion_resilie_1mois_15j Somme_prime_avant_resil Somme_prime_apres_resil evol_moyenne_resil;
79         define Marche / display "Marché"  ;
80         define PoleMarche / display "Pôle de Marché"  ;
81         define nb_contrat_au_terme / display "Nombre de contrat passé au terme"  ;
82         define Somme_prime_avant / display "Prime avant en K€"  ;
83         define Somme_prime_apres / display "Prime après en K€"  ;
84         define evol_moyenne / display "Evolution moyenne de la prime"  ;
85         compute evol_moyenne;
86         if evol_moyenne>&palier_evol. then call define (_ROW_,‘style’,‘style=[background=lightblue foreground=red ]);
87         endcomp;
88         define Resilie_1mois_et_15j / display "Nombre de contrat pour ce terme résilié sous délai 45j";
89         define proportion_resilie_1mois_15j / display "Proportion resilie / nombre de contrat total"  ;
90         define Somme_prime_avant_resil / display "Prime avant résilié en K€"  ;
91         define Somme_prime_apres_resil / display "Prime après résilié en K€"  ;
92         define evol_moyenne_resil / display "Evolution moyenne resilié"  ;
93         run;
 
ERROR: Undeclared array referenced: NAME.
ERROR: Variable NAME has not been declared as an array.
1           if evol_moyenne> 3.6% then call define (_ROW_,‘style’,‘style=[background=lightblue foreground=red ]);
3                                                          Le Système SAS                           10:20 Tuesday, February 28, 2017
 
                                _           ______        _                                    __________      _
                                388         68            386                                  22              200
                                200                       200
ERROR 388-185: Expecting an arithmetic operator.
 
ERROR 68-185: The function DEFINE is unknown, or cannot be accessed.
 
ERROR 386-185: Expecting an arithmetic expression.
 
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, ',', -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, 
              GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, [, ^=, {, |, ||, ~=.  
 
ERROR 200-322: The symbol is not recognized and will be ignored.
 
1        !  if evol_moyenne> 3.6% then call define (_ROW_,‘style’,‘style=[background=lightblue foreground=red ]);
                                                                                                               _
                                                                                                               22
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, ), *, **, +, ',', -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, 
              GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.  
 
NOTE: The preceding messages refer to the COMPUTE block for evol_moyenne.
NOTE: Will not run due to compilation errors.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 16 observations read from the data set WORK.SELECTION_FINAL.
NOTE: PROCEDURE REPORT used (Total process time):
      real time           0.02 secondes
      cpu time            0.03 secondes



Qulequ'un aurait 1 idée? j'ai pourtant suivi le code sas clairement expliqué ici : https://thesasreference.wordpress.co...ort_ods_color/

Ou alors c'est 1 problème de version SAS ?

Merci de votre aide.