BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LuisValença
Calcite | Level 5

I have a field that may or may not have spaces at the beginning. When I use the proc report to format a report, the leading spaces are suppressed. What to do for the spaces are printed?

This is the example:

a) proc report data=facturas2(where=(comp='011') drop=cod_linha) nowindows COLWIDTH=131 missing

   style(report)=[rules=none frame=void fontsize=8pt outputwidth=100%]

   style(lines)=[font=("Courier New", 8pt)];

   column linha1;

   define linha1 / "" width=124 format=$124. style=[font=("Courier New", 7pt)  cellheight=1pt];

   quit;

b) data

     linha1 - "     Department" with 5 spaces at the beginning

     linha1 - "          Unit" with 10 spaces at the beginning

c) Current report

     Department

     Unit

Any help or hints are appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

Add a style into it.

asis=on

Ksharp

View solution in original post

3 REPLIES 3
Cynthia_sas
SAS Super FREQ

Hi:

  You did not say what your destination of interest was. LISTING? HTML? RTF? PDF? Techniques for "padding" will differ depending on the destination of interest and on your version of SAS.

cynthia

LuisValença
Calcite | Level 5

Hi

The report will be produced in pdf with the following code:

options nodate nonumber linesize=200 pagesize=70 leftmargin=.5in rightmargin=.5in topmargin=.5in bottommargin=.5in;

ods escapechar='^';
ods listing close;
ods pdf file="c:\temp\teste_factura.pdf";

title1 j=l '^S={preimage="G:\SVB\DCT\FACT_SVB\Factura via EMAIL\Aplicação\millen2.bmp"}                                 ORIGINAL';

footnote h=6pt f="Arial" j=l "Processado por computador";
ods pdf StartPage=Never;
ods noproctitle;

proc report data=facturas2(where=(comp='011') drop=cod_linha) nowindows COLWIDTH=131 missing
style(report)=[rules=none frame=void fontsize=8pt outputwidth=100%]
style(lines)=[font=("Courier New", 8pt)];
column linha1;
define linha1 / display "" width=124 format=$124. style=[font=("Courier New", 7pt) font_weight=bold  cellheight=1pt];
quit;

ods _all_ close;

Thanks

Ksharp
Super User

Add a style into it.

asis=on

Ksharp

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