BookmarkSubscribeRSS Feed
NCNyrk
Calcite | Level 5
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?
5 REPLIES 5
Cynthia_sas
SAS Super FREQ
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
don21
Quartz | Level 8

Hi Cynthia,

 

What if I want to preserve the format that applied for a variable in proc report to be displayed as is in ODS output..?

 

Thank you,

 

Cynthia_sas
SAS Super FREQ
Hi:
It's not a good idea to add a new question to an 11 year old forum posting. I almost didn't read this because it was so old. I just figured there was a glitch of some kind in the forum interface.

To post a new question, if it is related to a previous post, you can put a link to the previous post in your new post. I don't understand what you mean when you say that you want to "preserve the format" -- typically with "regular" ODS destinations, such as HTML, RTF and PDF, the SAS formats you use (as in a FORMAT statement) are respected. The only time SAS formats are not respected are when you create your output with an Excel-related destination. Excel has its own ideas about how to deal with variable formats and frequently does not respect the SAS format.

It would be better for you to start a new post in the ODS and Reporting forum, with a sample of your data or using a SASHELP data set and an example of the type of format you want preserved. Showing the code you're using, including your ODS destination statements would be very useful. Otherwise, everybody is guessing about what you mean and what your desired output is.

Cynthia
don21
Quartz | Level 8
Sure, will do.. Thanks Cynthia..
NCNyrk
Calcite | Level 5
Excellent! Worked perfect with Proc Report!

Thanks, Cynthia!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 5 replies
  • 5781 views
  • 2 likes
  • 3 in conversation