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

Hello everyone and anyone!  When you run the below code the display PDF number has space/separation from the title.  How do I re-format to the number of characters.

Current view: 'Total Number of Records:      2,020'

Want view: 'Total Number of Records: 2,020'

SAS Code:

ods pdf file="file path to save/Total Count.pdf";
options linesize=max;

proc sql noprint;
select
count(*) as Tot_Cnt format comma10.
into
:Obs
from SASHELP.aacomp
;
quit;
%put NOTE: &Obs;

ods pdf startpage=no;
ods proclabel='Title';
title bold height=22pt color=purple "Total Number of Records: &Obs.";
proc report data=SASHELP.aacomp;
run;
title;

ods pdf close;

 

Thank you for your support!

1 ACCEPTED SOLUTION
4 REPLIES 4
PaigeMiller
Diamond | Level 26
Current view: 'Total Number of Records:      2,020'

 

The easiest thing to do is to create this string without the unwanted blanks. If you can't do that, use the COMPBL function.

--
Paige Miller
ljim1075
Obsidian | Level 7

Thank you all for your feedback, I knew it had to be something simple.  The %LET did the work.

 

Thank you again!

andreas_lds
Jade | Level 19

Or add the option "trimmed" to the into-clause:

proc sql noprint;
  select count(*) as Tot_Cnt format comma10.
    into :Obs trimmed
    from SASHELP.aacomp
  ;
quit;

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 650 views
  • 4 likes
  • 4 in conversation