Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why have space in my text in my sas ods pdf

I want to make a pdf report in formula 1 GP, I have macro variables like the name of the GP, the year,… But in my pdf I have some space before or after my macro. I try to make some modification on my macro but without success. I put the result and a part of my code.

proc sql noprint;
  select trim(name) 
  into :gp_name
  from F1.race_data;
quit;

proc sql noprint;
  select trim(put(year , best.))
  into :gp_year
  from F1.race_data;
quit;

proc sql noprint;
  select trim(put(round , best.))
  into :gp_round
  from F1.race_data;
quit;

To make my pdf I have this

ODS PDF FILE= '/home/u59673531/SASII/Rapport_F1.pdf' style=rapport
    TITLE= 'Rapport GP F1'
    AUTHOR='ABC';
OPTIONS NODATE NONUMBER;
ODS ESCAPECHAR='^';
ODS PDF STARTPAGE=NEVER;

TITLE2 justify=LEFT  "Résumé du &gp_name";

ODS PDF TEXT="^{newline 1}";
ods text = "Voici le résumé du &gp_name sur le &gp_namegp pour le &gp_round e grand prix de la saison &gp_year se déroulant à &gp_local";

PROC PRINT DATA=F1.TABLE_GP NOOBS;
RUN;

And in my pdf I have this
enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

How I can resolve the problem with the space in my text ?

>Solution :

Use the TRIMMED option.

TRIMMED
trims the leading and trailing blanks from values that are stored in a single macro variable.

proc sql noprint;
  select trim(name) 
  into :gp_name TRIMMED
  from F1.race_data;
quit;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading