The SAS Output Delivery System and reporting techniques

Preserve Leading Blanks in ODS Output

Reply
Contributor
Posts: 21

Preserve Leading Blanks in ODS Output

I have a mainframe output file that I am trying to convert to a .PDF document to be e.mailed.

The file has been read in line by line as one variable, with an informat of $CHAR112. so that leading blanks are preserved.

If I use Proc Print or Proc Report to just dump the contents, the leading blanks are removed.

If I use DATA _NULL_ with FILE PRINT ODS, the leading blanks are also removed, even if I specify a format of $CHAR112. as a suboption.

The only method which almost works is a simple DATA _NULL_ with a regular PUT statement (not PUT _ODS_). The problem here is that I have to make the font very small to prevent this method from inserting a blank line between every output record, which is also not desired.

So, any ideas on how to maintain leading spaces and prevent extra lines from being printed?
SAS Super FREQ
Posts: 8,745

Re: Preserve Leading Blanks in ODS Output

Hi!
Try the style attribute ASIS=ON in your PRINT or REPORT --

Proc Report data=whatever nowd;
column bigline;
define bigline /display
style(column)={asis=on};
run;

OR
Proc Print data=whatever noobs;
var bigline / style(data)={asis=on};
run;

That attribute generally preserves leading blanks. You may also want to adjust your PDF orientation and/or margins using an option statement:

option orientation=landscape topmargin=.5in bottommargin=.5in leftmargin=.5in rightmargin=.5in;

ods pdf file='.....';

good luck!
cynthia
Contributor
Posts: 21

Re: Preserve Leading Blanks in ODS Output

Excellent! Worked perfect with Proc Report!

Thanks, Cynthia!
Ask a Question
Discussion stats
  • 2 replies
  • 1601 views
  • 1 like
  • 2 in conversation