Help using Base SAS procedures

Displaying data in Output Window

Accepted Solution Solved
Reply
Contributor
Posts: 44
Accepted Solution

Displaying data in Output Window

Occasionally, when I use Proc Print, it will display the variable names in the Output Window as per the attached diagram, SAS 1.jpg. I find this difficult to read. Is there an option in SAS which will force the variable names to always output to the window as per the second diagram, SAS 2.jpg? I have looked for information online but can find nothing.

TIA


SAS 1.JPGSAS 2.JPG

Accepted Solutions
Solution
‎08-02-2011 10:27 AM
PROC Star
Posts: 7,363

Displaying data in Output Window

Based on the other responses, the OP will discover which one they really want.  However, since the OP wanted it to always look like the SAS2.jpg example, I vote for heading=horizontal

View solution in original post


All Replies
Frequent Contributor
Posts: 75

Displaying data in Output Window

use the heading=vertical option;

proc print data=xxxxx heading=vertical; run;

SAS Super FREQ
Posts: 8,743

Displaying data in Output Window

Hi:

  To clarify:

HEADING=VERTICAL will always produce vertical headings, one character per line (as shown in SAS 1.jpg)

HEADING=HORIZONTAL should always produce horizontal headings, as shown in SAS 2.jpg.

Here's the doc:

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002291718.htm

  With horizontal headings, all your columns might not fit in the LINESIZE for the listing window. Possible workarounds are:

1) For LISTING output, increase the LINESIZE option to the maximum (options linesize=256Smiley Wink

2) For LISTING output, turn off centering to give maximum space (options linesize=256 nocenterSmiley Wink

3) switch to ODS HTML output, which can be as wide as it needs to be (instead of using LISTING destination output)

4) if you do not want to switch to HTML output, then for LISTING output control the split of the column headers with the SPLIT= option in PROC PRINT and a LABEL statement that uses the SPLIT character (as described in the above documentation link).

cynthia

Trusted Advisor
Posts: 2,113

Displaying data in Output Window

Actually, I think that it is

heading=horizontal.

Either way, you can see how to do it in the PROC PRINT documentation.

Frequent Contributor
Posts: 75

Re: Displaying data in Output Window

Doc- you are right. i thought mediaeval wanted the text to go from horizontal to vertical

Solution
‎08-02-2011 10:27 AM
PROC Star
Posts: 7,363

Displaying data in Output Window

Based on the other responses, the OP will discover which one they really want.  However, since the OP wanted it to always look like the SAS2.jpg example, I vote for heading=horizontal

Contributor
Posts: 44

Displaying data in Output Window

Thanks, everyone - I can't believe the solution is so simple! This has plagued me for ages Smiley Happy

Trusted Advisor
Posts: 2,113

Displaying data in Output Window

Even though I have used SAS for >30 years, I still find myself going back to the documentation.  One thing that has been nice in the newest version of the Enterprise Guide program editor is that it has a syntax completion function.  It doesn't tell me what the option does, but it makes me aware of the presence of the option.  (F1 goes to the context sensitive help.)

☑ This topic is SOLVED.

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

Discussion stats
  • 7 replies
  • 471 views
  • 0 likes
  • 5 in conversation