BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LukeL
Obsidian | Level 7

Hi all. I have a proble with the ods pdf text. I have to write a title page on a report, that takes string values from a macro variable passed to a macro.

The problem is that sometimes, when the text cannot fit a single line, it goes to a new one. And while sometimes all goes ok, some other time the space between the first and the second line is really too huge.

This is the macro that genrate the page:

%MACRO GENERA_COPERTINA_PROVINCIA(PRVC, PRST, LBLPROV=SI);
    TITLE1 " ";
	%GENERA_FOOTNOTE;
    ods layout start rows=1 row_gutter=0cm columns=1 column_gutter=0cm column_widths=(27cm);
        ods region column=1 row=1;
            ODS PDF TEXT="^15n ^S={font_size=22pt}Specialistica Ambulatoriale^3n";
            ODS PDF TEXT="^S={font_size=33pt}MAIN PAGE TITLE^7n";
			%if &LBLPROV.=SI %then %do;
				ODS PDF TEXT="^S={font_size=28pt}String &PRVC.^2n";
			%end;
			%else %do;
				ODS PDF TEXT="^S={font_size=28pt}&PRVC.^2n";
			%end;
			ODS PDF TEXT="^S={font_size=22pt}(some observations)^6n";
			ODS PDF TEXT="^S={font_size=25pt}Title:^1n";
			ODS PDF TEXT="^S={font_size=25pt}&PRST.^3n";
			ODS PDF TEXT="^S={font_size=22pt}time span:^1n";
			ODS PDF TEXT="^S={font_size=22pt}&TREND_RIF.";
    ods layout end;
%MEND GENERA_COPERTINA_PROVINCIA;

The problematic text is 

ODS PDF TEXT="^S={font_size=25pt}&PRST.^3n";

I attach an example of the output string with wrong spacing...

 

Any idea on how to solve?

 

Thanks all 🙂 


RightSpacing.pngWrongSpacing.png
1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
Hi:
The syntax you show for the newline ^3n and ^2n is older syntax which was changed between SAS 9.1.3 and SAS 9.2. This really needs to be debugged by Tech Support and the ODS and PDF experts there. I would recommend that you open a track with Tech Support.

cynthia

View solution in original post

4 REPLIES 4
ballardw
Super User

I would first verify the content of the macro variable. Since you do not describe how it is created other than comes from a macro, there is a chance that the generated macro contains either a line feed character or many spaces making the line in effect more than 2 print lines long.

LukeL
Obsidian | Level 7

Hi.

The macro just contain a string with no spaces and no line feed characters. It comes from a line of code generated as

call symput(compress("titlelabel"||left(put(_N_,4.))), %bquote(strip(PUT(COLUMN,$FORMAT.))));

in a data step that generate a lot of this macro variable that in every step are passed to the macro.

Cynthia_sas
SAS Super FREQ
Hi:
The syntax you show for the newline ^3n and ^2n is older syntax which was changed between SAS 9.1.3 and SAS 9.2. This really needs to be debugged by Tech Support and the ODS and PDF experts there. I would recommend that you open a track with Tech Support.

cynthia
LukeL
Obsidian | Level 7

Hi Cynthia.

I modified the code for using the "new" tag available from version 9.2, and now the problem no longer appears. Thanks for the reply 🙂

 

%MACRO GENERA_COPERTINA_PROVINCIA(PRVC, PRST, LBLPROV=SI);
    TITLE1 " ";
	%GENERA_FOOTNOTE;
    ods layout start rows=1 row_gutter=0cm columns=1 column_gutter=0cm column_widths=(27cm);
        ods region column=1 row=1;
            ODS PDF TEXT="^{newline 15} ^{style[font_size=22pt]Specialistica Ambulatoriale ^{newline 3}}";
            ODS PDF TEXT="^{style[font_size=33pt]MAIN PAGE TITLE ^{newline 7}}";
			%if &LBLPROV.=SI %then %do;
				ODS PDF TEXT="^{^style[font_size=28pt]String &PRVC.^{newline 2}}";
			%end;
			%else %do;
				ODS PDF TEXT="^{style[font_size=28pt]&PRVC. ^{newline 2}}";
			%end;
			ODS PDF TEXT="^{style[font_size=22pt](some observations) ^{newline 6}}";
			ODS PDF TEXT="^{style[font_size=25pt]Title: ^{newline}}";
			ODS PDF TEXT="^{style[font_size=25pt]&PRST. ^{newline 3}}";
			ODS PDF TEXT="^{style[font_size=22pt]time span: ^{newline}}";
			ODS PDF TEXT="^{style[font_size=22pt]&TREND_RIF.";
    ods layout end;
%MEND GENERA_COPERTINA_PROVINCIA;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5788 views
  • 0 likes
  • 3 in conversation