DATA Step, Macro, Functions and more

Formatting Column Names in Output

Accepted Solution Solved
Reply
Contributor
Posts: 23
Accepted Solution

Formatting Column Names in Output

I feel dumb asking this and I warn you I am new to SAS.  My column name in the output window is displayed in multiple lines

example:  Percent_

               Increase

How do I make my program format it so that the column name is all in one line like this: Percent_Increase. I would like to do this for all my column names eventually.

Many thanks in advance.


Accepted Solutions
Solution
‎02-13-2013 06:18 PM
Super User
Posts: 19,785

Re: Formatting Column Names in Output

Posted in reply to PhatRam33

Exactly.

What you should do is set up labels so that your data looks appropriate ie Percent_Increase = Percent Increase or % Increase

View solution in original post


All Replies
Super User
Posts: 19,785

Re: Formatting Column Names in Output

Posted in reply to PhatRam33

What are you using the output in the window for?

You should always output to some other destination (RTF, PDF, HTML) and use that instead...in my opinion.

Contributor
Posts: 23

Re: Formatting Column Names in Output

Well right now just to view the data but will eventually export to an excel file.. I suppose it won't matter then because I am assuming it will place the column header all in one line?

Right now I am using a proc print procedure to display my data.

Solution
‎02-13-2013 06:18 PM
Super User
Posts: 19,785

Re: Formatting Column Names in Output

Posted in reply to PhatRam33

Exactly.

What you should do is set up labels so that your data looks appropriate ie Percent_Increase = Percent Increase or % Increase

Super User
Posts: 11,343

Re: Formatting Column Names in Output

Posted in reply to PhatRam33

Also for proc print you can explicitly control the output column widths in ODS destinations (not the output widow).

Example:

proc print data=mydataset noobs label;

var firstvar / style=[cellwidth= 1.2in];

var secondvar / style=[cellwidth= .75in];

/*etc*/

run;

And make the cell widths either long enough for you labels to fit one row or to wrap comfortably.

Frequent Contributor
Frequent Contributor
Posts: 94

Re: Formatting Column Names in Output

Posted in reply to PhatRam33

Yes it should display correctly once you export it to Excel. It is appearing on two lines now just to preserve the output window space.

Contributor
Posts: 23

Re: Formatting Column Names in Output

Posted in reply to PhatRam33

Thank you everyone for the help. This is perfect =).

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 339 views
  • 6 likes
  • 4 in conversation