BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
acordes
Rhodochrosite | Level 12

I want ods to create a table of content. 

But it is empty. 

I'd like to reference in the TOC every table the proc generates. 

 

the trace on statement reveals the distinct tables:

 

Output Added:
-------------
Name: NObs
Label: Number of Observations
Template: freqTab.freqTab.NObs
Path: CAS.freqTab.NObs
-------------
Output Added:
-------------
Name: LevelInfo
Label: Variable Level Information
Template: freqTab.freqTab.LevelInfo
Path: CAS.freqTab.LevelInfo
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table1.OneWayFreqs
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table2.OneWayFreqs
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table3.OneWayFreqs
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table4.OneWayFreqs
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table5.OneWayFreqs
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table6.OneWayFreqs
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table7.OneWayFreqs
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table8.OneWayFreqs
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table9.OneWayFreqs
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table10.OneWayFreqs
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table11.OneWayFreqs
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table12.OneWayFreqs
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table13.OneWayFreqs
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table14.OneWayFreqs
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table15.OneWayFreqs
-------------
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table16.OneWayFreqs
-------------
Output Added:
-------------
Name: Timing
Label: Timing
Template: freqTab.freqTab.Timing
Path: CAS.freqTab.Timing
-------------
Output Added:
-------------
Name: OutputCasTables
Label: Output CAS Tables
Template: CAS.Common.OutputCasTables
Path: CAS.freqTab.OutputCasTables

 

 

And I have another challenge. How Do I output comments to the destination?

Imagine having a proc freq followed by a proc sgplot.

I want to add a comment lines BETWEEN the proc output so that I can guide the reader. 

 

pic.png

ods word file="/caslibs/marketing/&tab._topn.docx" options(contents="on" toc_data="on" keep_next="on");
title "Top 10 Freq";
ods proclabel=" ";

proc cas;   action freqTab.freqTab /displayOut={names={"OneWayFreqs"="out2"}} 
tabDisplay={format= "list", maxLevels=10,missingFreq=false} order= "FREQ", 
descending=false,table={name="ALEX_PPNC_HIST_V1", caslib="&casy."}      
tabulate={'Mes_Actual', 'Codigo_marca', 'Mes_actual_poliza', 'Tipo', 'Tipo_de_tarifa_de_seguro', 'Num_Siniestros', 
'Top_modelo', 'Grupo_duracion_contrato', 'Meses_contables_operacion', 'Tipo_de_cliente', 'Estado_operacion', 'Poliza_cancelada', 
'Operacion_viva', 'Poliza_en_riesgo_informe_TAM', 'Anyo_Vencimiento_operacion', 'NIF_CIF'};
run;

ods word close;

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Last time I checked ODS WORD is still not production.

I would recommend ODS RTF and then if a docx file format is required to use your word processor to change from RTF to docx.

View solution in original post

3 REPLIES 3
acordes
Rhodochrosite | Level 12

Ok, with an ODS text="your text"; line I can add text between proc outputs.

 

In the generated docx I can select the table to "insert caption". Then I create a table of figures and it recognizes the different tables.

Can I force the tables to have caption, i.e. the pathname from the trace log?

 

Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: freqTab.freqTab.OneWayFreqs
Path: CAS.freqTab.Table2.OneWayFreqs

 

 

acordes
Rhodochrosite | Level 12

I've seen that the ods pdf generates what I'm looking for.

But can ods word do the same?

 

pic1.png

 

ballardw
Super User

Last time I checked ODS WORD is still not production.

I would recommend ODS RTF and then if a docx file format is required to use your word processor to change from RTF to docx.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 323 views
  • 0 likes
  • 2 in conversation