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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
15 options nomprint nomlogic nosymbolgen nonotes;
16 DATA tous_clients;
17
18 input sem :2. pages :4. id_foy $;
19 cards;
86 ;
87 run;
88
89 %macro repet;
90
91 data tous_clients;
92 set %do i=1 %to 10000;
93 tous_clients
94 %end;;
95 run;
96
97 %mend;
98
99 %repet;
100 options notes fullstimer;
101 proc sql ;
101 ! *_method _tree ;
102 CREATE TABLE actifs2 AS
103 SELECT id_foy, max(top1) AS mtop1, max(top2) AS mtop2
104 FROM
105 (SELECT id_foy,
106 CASE WHEN 1<=sem<=25 THEN 1 ELSE 0 END AS top1,
107 CASE WHEN 45<=sem<=52 THEN 1 ELSE 0 END AS top2
108 FROM tous_clients
109 WHERE (1<=sem<=25 OR 45<=sem<=52)AND pages IN (1,564,9876)
110 )
111 GROUP BY id_foy
112 HAVING max(top1)=1 AND max(top2)=1;
NOTE: La table WORK.ACTIFS2 a été créée, avec 2 lignes et 3 col.
2 Le Système SAS 15:00 Wednesday, February 20, 2013
113 quit;
NOTE: Procédure SQL a utilisé (Durée totale du traitement) :
temps réel 0.85 secondes
temps UC utilisateur 0.37 secondes
temps UC système 0.04 secondes
Mémoire 18651k
Mémoire SE 143376k
Horodatage 20/02/2013 16:19:52
114
115
116 proc sql ;
116 ! *_method _tree ;
117 CREATE TABLE actifs1 AS SELECT DISTINCT t1.id_foy
118 FROM
119 (SELECT DISTINCT id_foy
120 FROM tous_clients(WHERE=(1<=sem<=25 AND pages IN (1,564,9876)))) t1
121 INNER JOIN
122 (SELECT DISTINCT id_foy
123 FROM tous_clients (WHERE=(45<=sem<=52 AND pages IN (1,564,9876)))) t2
124 ON (t1.id_foy = t2.id_foy);
NOTE: La table WORK.ACTIFS1 a été créée, avec 2 lignes et 1 col.
125 quit;
NOTE: Procédure SQL a utilisé (Durée totale du traitement) :
temps réel 0.59 secondes
temps UC utilisateur 0.36 secondes
temps UC système 0.01 secondes
Mémoire 11843k
Mémoire SE 137244k
Horodatage 20/02/2013 16:19:53
126
127 proc sql;
128 CREATE TABLE actifs1 AS SELECT distinct id_foy
129 FROM tous_clients
130 WHERE 45<=sem<=52 AND pages IN (1,564,9876)
131 AND id_foy IN (SELECT distinct id_foy FROM tous_clients WHERE 1<=sem<=25 AND pages IN
131 ! (1,564,9876));
NOTE: La table WORK.ACTIFS1 a été créée, avec 2 lignes et 1 col.
132 quit;
NOTE: Procédure SQL a utilisé (Durée totale du traitement) :
temps réel 0.57 secondes
temps UC utilisateur 0.23 secondes
temps UC système 0.09 secondes
Mémoire 11481k
Mémoire SE 136988k
Horodatage 20/02/2013 16:19:54
133 |
Partager