Cici
Cici

Reputation: 1447

how to Setting VIEWTABLE to show column names in SAS?

Problem Description: when viewing a sas table in VIEWTABLE, the header for each column is default to show column description, how do I make it show column name instead?

I am using SAS version:9.3

What I did so far: I found the following solution online (This solution was tested on SAS 9.2)

VT SASHELP.VCOLUMN COLHEADING=NAMES

when I run this command I was given the following error

8713  VT SASHELP.VCOLUMN COLHEADING=NAMES
      --
      180

ERROR 180-322: Statement is not valid or it is used out of proper order.

The point and click version of the solution did not work for me either.

Upvotes: 3

Views: 4676

Answers (1)

Joe
Joe

Reputation: 63424

That is a dm command, so you need to submit it to DM:

dm 'VT SASHELP.VCOLUMN COLHEADING=NAMES'; 

You could also assign that command (what you have, in mine just the part within the quotes) in KEYS ('keys' in the command bar). You also can do this on a case by case basis in the VIEW menu once you've opened the dataset.

The way to do this permanently:

  1. Open the Explorer (View -> Explorer)
  2. Tools->Options->Explorer
  3. Select Members
  4. Select Table, Edit
  5. Select &Open, Edit
  6. Add COLHEADING=NAMES to the end of the string already present (should be something like VIEWTABLE %8b."%s".DATA COLHEADING=NAMES after you finish).
  7. Save everything (OK to all dialog boxes).

This will only persist if save settings on exit is enabled in the preferences (tools-options-preferences) and this is not an rsasuser session (read-only access to user profiles).

Upvotes: 6

Related Questions