The SAS Output Delivery System and reporting techniques

Spacing and Formatting in Proc Report with ODS

Reply
N/A
Posts: 0

Spacing and Formatting in Proc Report with ODS

I want to put a space between the proc report and the title statement that contains a JPG. I'm not having any luck. Is there a better way to do it? Also is there a better way to also put spaces inbetween the twp proc reports? Code is below....

options nodate;
ods noptitle;
ods pdf startpage=never;
ods pdf file='c:\PC_SAS\Test Page 3 1.29.10.pdf' style=CustPge notoc;
title '^S={just=center preimage="C:\PC_SAS\ Logo For Top Of Report.JPG"}';

ods pdf text= '^S={just=center font=("Times Roman",13PT,Bold )}Who is taking money out of your pocket? ^n Competitive Retail Store Spending(Top 5 locations) ';

proc report data=projects.comp_ret_store_spend_top_5 nowd;
where dealer_number='0018';
/*title1 "Who's taking money out of your pocket? ^n Competitive Retail Store Spending(Top 5 locations)";*/
column description cnt amt;
define description/ display format=$80.;
define amt/ display format=dollar6.;
label description = "Competitor Name"
Cnt = "Transactions"
AMT = "Amount" ;
run;

ods pdf text=' ';
ods pdf text=' ';
ods pdf text=' ';
ods pdf text=' ';
ods pdf text=' ';
ods pdf text=' ';
ods pdf text=' ';
ods pdf text=' ';
ods pdf text=' ';
ods pdf text='^S={just=center font=("Times Roman",13PT,Bold )}Where are your top customers using their Cards? ^n (Top 5 other categories) ';
proc report data=projects.top_5_other_cat nowd;
where dlr_no='0018';
column sic_class cnt amt;
define sic_class/ display format=$80.;
define amt/ display format=dollar10.;
label sic_class = "Category"
Cnt = "Transactions"
AMT = "Amount" ;
run;

ods pdf close;
SAS Super FREQ
Posts: 8,868

Re: Spacing and Formatting in Proc Report with ODS

Posted in reply to deleted_user
Hi:
Do you mean you want a space BEFORE or AFTER the text string(s):
[pre]
Who is taking money out of your pocket? ^n Competitive Retail Store Spending(Top 5 locations)
[/pre]

(Because I would expect that you'd see this:
image
Who is taking money...
beginning of proc report table
at the top of your page. If I understand you correctly, you want the extra space UNDER the image???)

I see that you are using ODS ESCAPECHAR with ^n for a line feed. You might try a title with a "non-breaking" space using ODS Escapechar (escapechar+underscore). For example, if you wanted the spaces AFTER the image and BEFORE the "Who is taking money..." line:
[pre]
title '^S={just=center preimage="C:\PC_SAS\ Logo For Top Of Report.JPG"}';
title2 '^S={asis=on}^_ ^n ^_';
[/pre]

Which makes title2 a non-breaking space, a line feed and another non-breaking space. The ASIS=ON tells ODS to respect the leading and trailing spaces -- otherwise, there's a tendency for blank lines to be ignored. I see that you are using ODS PDF STARTPAGE=NEVER. There's no need for a separate statement for that. You could just as easily have done this:
[pre]
ods pdf ods pdf file='c:\PC_SAS\Test Page 3 1.29.10.pdf' style=CustPge notoc startpage=no;
[/pre]

(STARTPAGE=NEVER only has to do with the suppression of page breaks before SAS/GRAPH procedures and I don't see any SAS/GRAPH code in your example. STARTPAGE=NO should work OK for you.)

The only other thing you could do instead of multiple ODS PDF TEXT= lines would be to have 1 text with a multiple line feed ESCAPECHAR control string (such as ^9n in the code below):
[pre]
ods pdf text= '^S={asis=on}^_ ^9n ';
[/pre]

...but, if what you have (multiple ODS PDF TEXT= ' '; statements) is working for you, then there's nothing wrong with that.

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 442 views
  • 0 likes
  • 2 in conversation