BookmarkSubscribeRSS Feed
kiranp
Calcite | Level 5

When I create a RTF file but it ends up empty!

I have done this a thousand times before and have never had a problem before.

 

The difference this time, is that I have run two different macros previously in the program. What could have happened? I'm lost.

While searching for an answer within the program, I have notice that after I have ran the macros, I cannot get any output to the 'results viewer' nor the output window. I guess it is a setting somewhere, somehow, but I cannot figure out what is wrong.

 

Here is the 'standard' rtf code I have used:

ods listing close;

ods rtf file="S:\Projekt\XXX\Output\XXX_4juni2019.rtf";

ods escapechar='^';
title1 'Title';
proc report data=xxx_ut
style(report)={font_face=times font_size=1 bordercolor=black}
style(column)={just=left font_face=times background=white foreground=black font_size=1 bordercolor=black cellwidth=.6in}
style(header)={just=center font_face=times background=white cellheight=.6in foreground=black font_size=1 bordercolor=black cellwidth=.6in};
COLUMN sorta cat1 pfs;
DEFINE sorta / order order=internal noprint;
DEFINE cat1 / display style(column)={just=left cellwidth=20%}''       style(header)={just=left cellwidth=20%} ;
DEFINE pfs / display style(column)={just=left cellwidth=20%}''         style(header)={just=left cellwidth=20%} ;

run;title;footnote;

ODS rtf close;
ODS listing;

 

Many thanks for advice or ideas.

4 REPLIES 4
ballardw
Super User

@kiranp wrote:

When I create a RTF file but it ends up empty!

I have done this a thousand times before and have never had a problem before.

 

The difference this time, is that I have run two different macros previously in the program. What could have happened? I'm lost.

While searching for an answer within the program, I have notice that after I have ran the macros, I cannot get any output to the 'results viewer' nor the output window. I guess it is a setting somewhere, somehow, but I cannot figure out what is wrong.

 

Here is the 'standard' rtf code I have used:

ods listing close;

ods rtf file="S:\Projekt\XXX\Output\XXX_4juni2019.rtf";

ods escapechar='^';
title1 'Title';
proc report data=xxx_ut
style(report)={font_face=times font_size=1 bordercolor=black}
style(column)={just=left font_face=times background=white foreground=black font_size=1 bordercolor=black cellwidth=.6in}
style(header)={just=center font_face=times background=white cellheight=.6in foreground=black font_size=1 bordercolor=black cellwidth=.6in};
COLUMN sorta cat1 pfs;
DEFINE sorta / order order=internal noprint;
DEFINE cat1 / display style(column)={just=left cellwidth=20%}''       style(header)={just=left cellwidth=20%} ;
DEFINE pfs / display style(column)={just=left cellwidth=20%}''         style(header)={just=left cellwidth=20%} ;

run;title;footnote;

ODS rtf close;
ODS listing;

 

Many thanks for advice or ideas.


And what does the LOG show for your Proc Report code?

I suspect you will see one or more instances of data set(s) with 0 observations for the entire job. If the data set xxx_ut has no observations there is nothing for proc report to output.

 

You may have to turn on the options MPRINT and SYMBOLGEN prior to executing your macros to get more details of what is going on.

kiranp
Calcite | Level 5

@ballardw wrote:

And what does the LOG show for your Proc Report code?

I suspect you will see one or more instances of data set(s) with 0 observations for the entire job. If the data set xxx_ut has no observations there is nothing for proc report to output.

 

You may have to turn on the options MPRINT and SYMBOLGEN prior to executing your macros to get more details of what is going on.

**************

Many thank for feedback!

The log says:

...

NOTE: Writing RTF Body file: C:\Projekt\XX\Output\XX_4juni2019.rtf

...

NOTE: There were 8 observations read from the data set WORK.XXX_UT.
NOTE: PROCEDURE REPORT used (Total process time):
real time 0.12 seconds
cpu time 0.14 seconds

so there is data (going crazy) !!

I'll try MPRINT...

ballardw
Super User

Your first link doesn't link to any specific macro, so not terribly helpful.

 

Did you look to see if the RTF file was actually in the folder? And open it? I notice the LOG file name is not the same as in the code you posted previously :

ods rtf file="S:\Projekt\XXX\Output\XXX_4juni2019.rtf";

vs

NOTE: Writing RTF Body file: C:\Projekt\XX\Output\XX_4juni2019.rtf

Any chance that you looked in the wrong folder? Or are you manually editing things to obscure "sensitive" material?

 

If either of the macros used ODS _ALL_ CLOSE; or ODS HTML Close; then the results window would not have anything but the RTF might.

 

kiranp
Calcite | Level 5

Hi again many thanks for comittment to this problem

 

The RTFfile is created - every time - it is just all blank 

attaching another link to the macro I have used - I think the problem might be in here somewhere

https://support.sas.com/documentation/cdl/en/statug/67523/HTML/default/viewer.htm#statug_kaplan_sect...

 

I'll explore the MPRINT log and found some small adjustments to the code, but no break-through yet.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 4 replies
  • 763 views
  • 0 likes
  • 2 in conversation