Hello Experts,
Is it possible to make the ods word document with SAS 8.3 version ?
My code is :
ods noresults;
ods escapechar="^";
footnote4 J=Right font =Arial HEIGHT=8pt '^{thispage}/^{lastpage}';
options orientation=landscape /*topmargin=1.5cm bottommargin=1.5cm*/
leftmargin=1.5 cm rightmargin=1.5cm nodate nonumber;
ods word file="&Publications.\ANNEXE_FI_&DatePubli..docx";
proc report data=Resultats split='|' nowd
style(report)=[ frame = hsides background = white bordercolor = CX1457D9 borderwidth =.1cm rules=rows just=left] style(header)=[background =white font_size = 8pt font_face = 'Arial' font_weight = bold color=black just = center bordercolor = white] style(column)=[font_size = 8 pt font_face = 'Arial' bordercolor=black color =black just = c];
columns ('Annexe fi' ( "Code ISIN"n
"Nom support"n
"Société de gestion"n)) ('' ("Performance brute de l'actif N1"n ))
('' ("Frais de gestion de l'actif"n ))
('' ("Performance nette de l'UC"n ))
('' ("Frais de gestion du contrat"n ))
('' ("Performance finale"n ))
( ("Taux de rétrocessions de commiss"n ))
;
define "Code ISIN"n / display "Code ISIN" style(header)=[background =CX1457D9 font_size = 8pt font_face = 'Arial' font_weight = medium color=white borderrightcolor =CX1457D9 borderleftcolor =CX1457D9 borderleftwidth=0.6pt just = c]style(column)=[ borderleftcolor=CX1457D9 just = l font_size = 7pt cellwidth=2.5 cm borderleftwidth=0.6pt];
define "Nom support"n / display "Libellé" style(header)=[background =CX1457D9 font_size = 8pt font_face = 'Arial' font_weight = medium color=white just = c borderleftcolor =CX1457D9 borderleftwidth=0.6pt] style(column)=[ borderleftcolor=CX1457D9 just = l font_size = 7pt cellwidth=5 cm borderleftwidth=0.6pt];
define "Société de gestion"n / display "Société de gestion" style(header)=[background =CX1457D9 font_size = 8pt font_face = 'Arial' font_weight = medium color=white just = c borderleftcolor =CX1457D9 borderleftwidth=0.6pt] style(column)=[ borderleftcolor=CX1457D9 just = l font_size = 7pt cellwidth=5 cm borderleftwidth=0.6pt];
define "Performance brute de l'actif N1"n / display "Performance brute|de l'actif N1|(A)" style(header)=[background =CX1457D9 font_size = 8pt font_face = 'Arial' font_weight = medium color=white just = c borderleftcolor =CX1457D9 borderleftwidth=0.6pt] style(column)=[ borderleftcolor=CX1457D9 just = r font_size = 7pt cellwidth=2 cm borderleftwidth=0.6pt];
define "Frais de gestion de l'actif"n / display "Frais de gestion|de l'actif|(B)" style(header)=[background =CX1457D9 font_size = 8pt font_face = 'Arial' font_weight = medium color=white just = c borderleftcolor =CX1457D9 borderleftwidth=0.6pt] style(column)=[ borderleftcolor=CX1457D9 just = r font_size = 7pt cellwidth=2 cm borderleftwidth=0.6pt];
define "Performance nette de l'UC"n / display "Performance nette|de l'unité de compte N-1|(A-B)" style(header)=[background =CX1457D9 font_size = 8pt font_face = 'Arial' font_weight = medium color=white just = c borderleftcolor =CX1457D9 borderleftwidth=0.6pt] style(column)=[ borderleftcolor=CX1457D9 just = r font_size = 7pt cellwidth=2 cm borderleftwidth=0.6pt];
define "Frais de gestion du contrat"n / display "Frais de gestion|du contrat**|(C)" style(header)=[background =CX1457D9 font_size = 8pt font_face = 'Arial' font_weight = medium color=white just = c borderleftcolor =CX1457D9 borderleftwidth=0.6pt] style(column)=[ borderleftcolor=CX1457D9 just = r font_size = 7pt cellwidth=2 cm borderleftwidth=0.6pt];
define "Performance finale"n / display "Performance|finale|(A-B-C)" style(header)=[background =CX1457D9 font_size = 8pt font_face = 'Arial' font_weight = medium color=white borderleftcolor =CX1457D9 just = c borderleftwidth=0.6pt] style(column)=[ borderleftcolor=CX1457D9 just = r font_size = 7pt cellwidth=2 cm borderleftwidth=0.6pt];
define "Taux de rétrocessions de commiss"n / display "Taux de rétrocessions|de commissions" style(header)=[background =CX1457D9 font_size = 8pt font_face = 'Arial' font_weight = medium color=white borderrightcolor =CX1457D9 just = c borderrightwidth=0.6pt just = c borderleftcolor =CX1457D9] style(column)=[ borderleftcolor=CX1457D9 borderrightcolor=CX1457D9 just = r borderrightwidth=0.6pt borderleftwidth=0.6pt font_size = 7pt cellwidth=2.2 cm];
run;
ods word close;
The data is joined.
I have no error but I can't open the file :
Thank you for the help !
ODS Word is still pre-production. That means that it may have problems, and some of them may not be obvious.
I suggest using ODS RTF and then use a word processing program to convert to DOCX if needed.
I have tried ODS Word with some Proc Tabulate tables that have worked with RTF for years and wasn't happy with results though graphs from Proc SGplot seem to work fine.
ODS Word is still pre-production. That means that it may have problems, and some of them may not be obvious.
I suggest using ODS RTF and then use a word processing program to convert to DOCX if needed.
I have tried ODS Word with some Proc Tabulate tables that have worked with RTF for years and wasn't happy with results though graphs from Proc SGplot seem to work fine.
@SASdevAnneMarie wrote:
Thank you ballardw !
RTF is works.
How to convert the RTF file to DOCX please ?
I would suggest clicking on the RTF document outside of SAS and see which program opens (If you have Word installed that is likely to be the program). Then in that program File Save AS and select DOCX as the file format.
@SASdevAnneMarie wrote:
Thank you, Ballardw!
That works !
I would hope so. On some days I do this more than 25 times. (I really don't like the appearance of some of ODS Word output for some of my tables.)
Did you actually write anything to the WORD document?
Doesn't that first line shut down ODS from writing anything?
ods noresults;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.