Précédent   Forum du club des développeurs et IT Pro > Logiciels > Solutions d'entreprise > Business Intelligence > SAS > ODS et reporting
ODS et reporting Forum d'entraide sur les fonctionnalités de reporting de SAS : gérer les sorties et graphiques de SAS
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 09/01/2013, 13h02   #1
Manoutz
Membre Expert
 
Homme
Biostatisticien
Inscription : juin 2009
Messages : 1 198
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : Irlande

Informations professionnelles :
Activité : Biostatisticien
Secteur : Industrie Pharmaceutique

Informations forums :
Inscription : juin 2009
Messages : 1 198
Points : 1 919
Points : 1 919
Par défaut Obtention d'un template specifique en rtf

Salut a tous,

Je dois obenir une sortie specifique, cf piece jointe.Au final, il y aura plusieurs pages, une par categorie.

Pour l'obtention des QQ plot, pas de soucis, une proc univariate suivi d'une Greplay et le tour est joue.

Je me casse plus les dents sur l'inclusion des cellulles au dessus (category 1) et en dessous... Sachant que je dois avoir une sortie RTF, on peux abandonner l'ods region. Avez vous une idee pour faire cela? J'ai essaye de bricoler un truc avec titres et footnote mais c'est pas terrible..

Deuxieme question, savez vous comment redimmensionner la taille du rectangle en sortie pour qu'il soit exactement aux dimensions de l'attache, sans retirer les graphes?

Merci d'avance a tous ceux qui vont m'aider.

Manoutz

mon code pour base de depart:

Code :
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
%macro QQPLOT(wk=,GROUP=, IN=, var=, titlenb=);
%IF &titlenb=1 %then %do;
PROC UNIVARIATE DATA=&IN.(WHERE=(week=&wk. AND grp IN (%cmpres("&group.")))) noprint;
	VAR &var.; 
	QQPLOT &var./ name="st%sysfunc(substr(&group.,6))wk&wk." nohlabel novlabel;
	TITLE "&wk. Week" justify=LEFT;
	TITLE2 "Normal probability plot" ;
	FOOTNOTE "&group." height=30 IN ;
RUN;
%end;
%else %do;
	PROC UNIVARIATE DATA=&IN.(WHERE=(week=&wk. AND grp IN (%cmpres("&group.")))) noprint;
		VAR &var.; 
		QQPLOT &var./ name="st%sysfunc(substr(&group.,6))wk&wk." nohlabel novlabel;
		FOOTNOTE "&group." height=30 IN ;
		TITLE " ";
		TITLE2 "Normal probability plot" ;
	RUN;
%end;
 
%mend QQPLOT;
 
 
%macro week1and2;
%do i=1 %TO 2;
goptions device=gif gsfname=nesug%cmpres(&i.);
filename nesug%cmpres(&i.) "H:\Week%cmpres(&i.).gif";
proc greplay tc=work.tempcat  nofs;
tdef newtemp des='Three panel template'
1/ulx=1 uly=75
urx=33 ury=75
llx=1 lly=25
lrx=33 lry=25
2/ulx=34 uly=75
urx=66 ury=75
llx=34 lly=25
lrx=66 lry=25
3/ulx=66 uly=75
urx=99 ury=75
llx=66 lly=25
lrx=99 lry=25
;
**************************************************************************
Above makes the template, below uses it;
template newtemp;
igout work.gseg;
gout work.gseg;
treplay
1:st002wk%cmpres(&i.)
2:st003wk%cmpres(&i.)
3:st003wk%cmpres(&i.)
name="Week%cmpres(&i.)";
quit;
%end;
%mend;
 
%macro week3and4;
%do i=3 %TO 4;
goptions device=gif gsfname=nesug%cmpres(&i.);
filename nesug%cmpres(&i.) "H:\Week%cmpres(&i.).gif";
proc greplay tc=work.tempcat  nofs;
tdef newtemp des='Two panel template'
1/ulx=9 uly=75
urx=42 ury=75
llx=9 lly=25
lrx=42 lry=25
2/ulx=58 uly=75
urx=91 ury=75
llx=58 lly=25
lrx=91 lry=25
;
**************************************************************************
Above makes the template, below uses it;
template newtemp;
igout work.gseg;
gout work.gseg;
treplay
1:st002wk%cmpres(&i.)
2:st002wk%cmpres(&i.)
name="Week%cmpres(&i.)";
quit;
%end;
%mend;
/***********************************************************************/
/*************                Data Section                **************/
/***********************************************************************/
 
proc format;
	value weeknb
		1="1 week"
		2="2 week"
		3="3 week"
		4="4 week"
	;
quit;
 
 
%QQPLOT(wk=1,GROUP=gr1,IN=VAS,var=vargg, titlenb=1);
%QQPLOT(wk=2,GROUP=gr1,IN=VAS,var=vargg, titlenb=1);
%QQPLOT(wk=3,GROUP=gr1,IN=VAS,var=vargg, titlenb=1);
%QQPLOT(wk=4,GROUP=gr1,IN=VAS,var=vargg, titlenb=1);
 
%QQPLOT(wk=1,GROUP=gr2,IN=VAS,var=vargg, titlenb=0);
%QQPLOT(wk=2,GROUP=gr2,IN=VAS,var=vargg, titlenb=0);
 
/***********************************************************************/
/*************                Report Section              **************/
/***********************************************************************/
options orientation= landscape ;
 
%week1and2;
%week3and4;
 
 
options noxsync noxwait xmin; *Important options TO SET when
USING DDE;
filename wordsys dde "winword|system"; *SET up the
conversation BETWEEN Word AND SAS;
*The code below (borrowed FROM one of the many excellent DDE
papers BY Koen Vyverman) Checks TO see IF Word IS open
already, AND opens it IF it IS NOT.;
DATA _null_;
length fid rc start stop time 8;
fid=fopen('wordsys','s');
IF (fid le 0) then do;
rc=system('start winword');
start=datetime();
stop=start+10;
do while (fid le 0);
fid=fopen('wordsys','s');
time=datetime();
IF (time ge stop) then fid=1;
end;
end;
rc=fclose(fid);
run;
 
 
 
DATA _null_;
file wordsys;
put '[FileNewDefault]'; *1) Open a blank Word document. WORD
must be open already!!;
put '[Filepagesetup .TopMargin=".02 in" .bottommargin="0.02 in"
.leftmargin="0.02 in" .rightmargin="0.02 in" ]'; * 2) Fix the Margins;
put '[Toggleportrait]'; *3) Turn page orientation TO landscape;
put '[InsertPicture "'"H:\Week1.gif"'"]'; 
put '[InsertPicture "'"H:\Week2.gif"'"]'; 
put '[InsertPicture "'"H:\Week3.gif"'"]';
put '[InsertPicture "'"H:\Week4.gif"'"]'; *4) Inserts our graph;
put '[Editgoto "g"]';
put '[CharRight 1,1]'; *5a) Selects the Graph;
put '[Centerpara]'; *5b) Centers it;
* 6) based ON DEFAULT CGM size (AS imported INTO MS WORD) of
approximately 3 inches BY 4.00 inches this fits perfectly!!;
put '[FormatPicture .scaleX="100%" .scaleY="100%"]';
put '[FileSaveAs .Name = "' "H:\graphout.doc" '" .format=0]';
*Save our new file;
put '[Fileclose]';*IF done;
run;
Fichiers attachés
Type de fichier : doc QQplot.doc (1,13 Mo, 6 affichages)
Manoutz est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 20h59.


 
 
 
 
Partenaires

Hébergement Web