Bonjour à tous,

Je remplis un tableau à l'aide de querrys sql, mon problème est qu'en fait les 3 premières lignes de la 1ere colonne sont correctement remplies, mais à partir de la 2ieme colonne, les 3 première lignes sont vides, et les 3 suivantes remplies etc.

j'ai fait différents essais au niveau du code:

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
 
title "Repartition des scores BDHI entre les 3 tertiles";
proc univariate data=total noprint;
var bdhi_impul bdhi_hostind bdhi_irritab bdhi_negativ bdhi_ressent bdhi_suspic bdhi_hostivb bdhi_culpab;
output out=Pctls 	pctlpts  = 33.33 66.66
                  	pctlpre  = impul hostind irritab negativ ressent suspic hostivb culpab
                  	pctlname = pct33 pct66;
run;proc print;run;
proc sql;
 
select distinct impulpct33, impulpct66, hostindpct33, hostindpct66, irritabpct33, irritabpct66, negativpct33, negativpct66, ressentpct33, ressentpct66, suspicpct33, suspicpct66, hostivbpct33, hostivbpct66, culpabpct33, culpabpct66
into :impulpct33, :impulpct66, :hostindpct33, :hostindpct66, :irritabpct33, :irritabpct66, :negativpct33, :negativpct66, :ressentpct33, :ressentpct66, :suspicpct33, :suspicpct66, :hostivbpct33, :hostivbpct66, :culpabpct33, :culpabpct66
from pctls;
 
create table work.bdhi (bdhi_impul num,bdhi_hostind num, bdhi_irritab num, bdhi_negativ num, 
						bdhi_ressent num, bdhi_suspic num, bdhi_hostivb num, bdhi_culpab num);
 
insert into work.bdhi 	set bdhi_impul =(select(count(bdhi_impul)) from total where bdhi_impul<&impulpct33)
						set bdhi_impul =(select count(bdhi_impul) from total where &impulpct33<=bdhi_impul<=&impulpct66)
						set bdhi_impul =(select count(bdhi_impul) from total where bdhi_impul>&impulpct66);
 
insert into	work.bdhi	set bdhi_hostind =(select count(bdhi_hostind)from total where bdhi_hostind<&hostindpct33)
						set bdhi_hostind =(select count(bdhi_hostind)from total where &hostindpct33<=bdhi_hostind<=&hostindpct66)
						set bdhi_hostind =(select count(bdhi_hostind)from total where bdhi_hostind>&hostindpct66);
 
quit;
et

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
 
select distinct impulpct33, impulpct66, hostindpct33, hostindpct66, irritabpct33, irritabpct66, negativpct33, negativpct66, ressentpct33, ressentpct66, suspicpct33, suspicpct66, hostivbpct33, hostivbpct66, culpabpct33, culpabpct66
into :impulpct33, :impulpct66, :hostindpct33, :hostindpct66, :irritabpct33, :irritabpct66, :negativpct33, :negativpct66, :ressentpct33, :ressentpct66, :suspicpct33, :suspicpct66, :hostivbpct33, :hostivbpct66, :culpabpct33, :culpabpct66
from pctls;
 
create table bdhi_impul (bdhi_impul num);
create table bdhi_hostind num), bdhi_irritab num, bdhi_negativ num, 
						bdhi_ressent num, bdhi_suspic num, bdhi_hostivb num, bdhi_culpab num);
 
insert into work.bdhi (bdhi_impul,label="Repartition des effectifs entre les tertiles bdhi impul")
select count(bdhi_impul) label="effectif tertile inférieur bdhi_impul"
from total
where bdhi_impul<&impulpct33;
insert into work.bdhi (bdhi_impul, label="Repartition des effectifs entre les tertiles bdhi impul")
select count(bdhi_impul) label="effectif tertile median bdhi_impul"
from total
where &impulpct33<=bdhi_impul<=&impulpct66;
insert into work.bdhi (bdhi_impul, label="Repartition des effectifs entre les tertiles bdhi impul")
select count(bdhi_impul) label="effectif tertile superieur bdhi_impul"
from total
where bdhi_impul>&impulpct66;
 
insert into work.bdhi (bdhi_hostind, label="Repartition des effectifs entre les tertiles bdhi hostind") select count(bdhi_hostind) label="effectif tertile inférieur bdhi_hostind"
from total
where bdhi_hostind<&hostindpct33;
insert into work.bdhi (bdhi_hostind, label="Repartition des effectifs entre les tertiles bdhi hostind") select count(bdhi_hostind) label="effectif tertile median bdhi_hostind"
from total
where &hostindpct33<=bdhi_hostind<=&hostindpct66;
insert into work.bdhi (bdhi_hostind, label="Repartition des effectifs entre les tertiles bdhi hostind") select count(bdhi_hostind) label="effectif tertile superieur bdhi_hostind"
from total
where bdhi_hostind>&hostindpct66;
Avez vous une idée svp pour que le tableau ne fasse que 3 lignes, et que je puisse remplir mes colonnes sur 3 lignes (les 3 premières), à chaque fois?

Merci d'avance,
Cordialement,