- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to print text into pdf document. I've provided example below. Can you please suggest how I can achieve this?
ods pdf file = "/folder1/checks_report.pdf" style=custom_matth notoc;
data _null_;
put "Check1 has &check1.ed";
put "This month Volume is &this_mon_vol";
put "Mean Volume of last 12 months trend is &mean_volume";
put "Std Deviation of last 12 months trend is &std_volume";
put "Lower limit for volume is &lower_limit_volume";
put "Upper limit for volume is &upper_limit_volume";
run;
ods pdf close;
run;
I want the below result in a pdf.
Check1 has passed
This month Volume is 22346
Mean Volume of last 12 months trend is 17982
Std Deviation of last 12 months trend is 3297
Lower limit for volume is 11388
Upper limit for volume is 24576
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Use proc print or proc report on the dataset:
ods pdf file...; data temp; text="Check..."; output; text="This month..."; output; ... run; proc print data=temp; run; ods pdf close;
You can fiddle around with proc print or proc report options to remove labels and such like.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Use proc print or proc report on the dataset:
ods pdf file...; data temp; text="Check..."; output; text="This month..."; output; ... run; proc print data=temp; run; ods pdf close;
You can fiddle around with proc print or proc report options to remove labels and such like.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It works as I expected. Thanks!
However is there a way I could suppress variable name to be shown on the report? In below report check1 is my variable name which is printing. I would like not to display that.
|
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you use PROC REPORT, it has the NOHEADER option, which will suppress the column headers. If you use PROC PRINT then you will have to settle for just turning the label off with a LABEL statement, but the header cell will still be there.
cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you!
I'm trying 3 proc reports in ods pdf. Each proc report is printing in different page. I need all of them to print in a single page. Is it possible?
ods pdf file = "/folder1/checks_report1.pdf" style=custom_matth notoc;
proc report data=check1 nowd noheader;
title 'Check1';
define check1 / style=[font_weight=bold font_size=14pt];
column check1;
run;
proc report data=check2 nowd noheader;
title 'Check2';
define check2 / style=[font_weight=bold font_size=14pt];
column check2;
run;
proc report data=check3 nowd noheader;
title 'Check3';
define check3 / style=[font_weight=bold font_size=14pt];
column check3;
run;
ods pdf close;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Investigate the STARTPAGE=NO option for ODS PDF.
cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you! It works. But, now its printing only 1 title. The first title. I would like to have all 3 titles and their tables listed in 1 page.
ods pdf startpage=YES;
proc report data=check1 nowd noheader;
title 'Check1';
define check1 / style=[font_weight=bold font_size=14pt];
column check1;
run;
ods pdf startpage=NO;
proc report data=check2 nowd noheader;
title 'Check2';
define check2 / style=[font_weight=bold font_size=14pt];
column check2;
run;
ods pdf startpage=NO;
proc report data=check3 nowd noheader;
title 'Check3';
define check3 / style=[font_weight=bold font_size=14pt];
column check3;
run;
ods pdf close;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes, PDF is fairly sticky about titles. A page only has 1 title. So the title for the first procedure step wins and gets the top of the page.
Since you are using PROC REPORT, you could add this to each PROC REPORT step, instead of a title:
compute before _page_;
line "Check ??";
endcomp;
And that would put the string you want BEFORE each table. Or, you could use ODS TEXT= before each of the PROC REPORT steps...the only downside of ODS TEXT= is that you'll have to fiddle to get the formatting the way you want.
There are ways around what's happening, but the TITLE statements are not used with ODS PDF when you use STARTPAGE=NO.
http://support.sas.com/techsup/notes/v8/8/044.html shows one approach and this Tech Support notes shows another approach with text between tables: http://support.sas.com/kb/43/259.html
cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
ods pdf file = "/folders/myfolders/checks_report.pdf" style=sasweb notoc;
data _null_;
file print;
put "Check1 has &check1.ed";
put "This month Volume is &this_mon_vol";
put "Mean Volume of last 12 months trend is &mean_volume";
put "Std Deviation of last 12 months trend is &std_volume";
put "Lower limit for volume is &lower_limit_volume";
put "Upper limit for volume is &upper_limit_volume";
run;
ods pdf close;