SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
Ujjawal
Quartz | Level 8

I am labeling variables with LABEL statement. It labels correctly but it is not shown in the data set.

What i mean - The variable label should be dispayed instead of variable name when i open data set.

Can both be displayed when someone point cursor on the variable? I am using SAS EG5.1.

5 REPLIES 5
Kanna
Calcite | Level 5

In EG and Base SAS you can only have either the column name or the label displayed, you cannot have both. To see both, right-click on the table in the library, Properties, Columns. There you scroll right, and the labels would be shown on each column.

To change the settings to show labels instead of column names do this: Find Tools on the menu bar, then Options, look at the drop down screen.

Locate on the left Data,  Data General. Toward the middle,  Naming Options: check the box for  "Use labels for column names"

This is in SAS EG 6.1. Look for similar settings in 5.1, it should not be very different.

Ujjawal
Quartz | Level 8

Is it possible via code to show labels instead of column names? Not all variables have variable label. Only selected variables have variable labels. I want to display variable label of these selected variables.

Kanna
Calcite | Level 5

You may want to play with the options listed here,

How to View DICTIONARY Tables

also ask SAS Tech support for help.

http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p00cato8pe46ein1bjci...

kamna
Calcite | Level 5

what would be the settings for sas version 9?

SASKiwi
PROC Star

In EG, from the Tools menu, select options, then Data, then tick the box for "Use labels for column names". If you hover over the column heading it will tell you what the variable name is. If the variable does not have a label the variable name is shown instead.

There is no way to switch this on in code.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 17950 views
  • 0 likes
  • 4 in conversation