sas >> Print a list of all variables, format, labels and value labels

by skauchali » Sat, 14 May 2005 14:29:29 GMT

Hello all; thanks for taking this little questions. I am a novice with
SAS, but have a steep learning curve. I have tried to print a list of
all variables with their labels and format type (char or num, etc) in
my database using the PROC CONTENTS function. What it does not place in
this output is a list of VALUE LABELS (e.g for variable Gender: Values
1, 2: Value labels 1-FEMALE 2-MALE); Yes, I have these value labels in
the database that are in 'lookup tables', that I created using EpiInfo
V3.2.2 (MSAccess backend). My question is: how do I get SAS PROC
CONTENTS print these value labels out, so that I have a comprehensive
CODEBOOK ready for use. My workaround this difficulty is to print using
PROC CONTENTS as RTF using ODS output style; then adding a column for
Value Labels and manually enter these for all variables that have been
entered 'comment legal' values.

Many thanks once again.
Best wishes,
Shuaib


sas >> Print a list of all variables, format, labels and value labels

by nospam » Sun, 15 May 2005 20:39:56 GMT


I presume that the 'lookup tables' to which you refer are formats, since
SAS does not support 'lookup tables' per se, and formats are the usual
device for managing value labels.

PROC FORMAT's CNTLOUT option will export the labels to a data set. You can
combine such a data set with the PROC CONTENTS output to build your
codebook. It may be possible to do this with a MERGE statement, but if a
format has two or more labels and is used with two or more variables you
are dealing with a many-to-many combination, where a PROC SQL join will be
advantageous.

sas >> Print a list of all variables, format, labels and value labels

by Bob_Abelson » Mon, 16 May 2005 21:46:48 GMT

Shuaib,

You can't get this from PROC CONTENTS alone. You will need to use PROC
FORMAT to get at the value labels for the formats, and then merge that
output with your PROC CONTENTS output.

HTH,

Bob Abelson
HGSI
240 314 4400 x1374
XXXX@XXXXX.COM




skauchali < XXXX@XXXXX.COM >
Sent by: "SAS(r) Discussion" < XXXX@XXXXX.COM >
05/14/2005 02:29 AM
Please respond to skauchali


To: XXXX@XXXXX.COM
cc:
Subject: Print a list of all variables, format, labels and value labels


Hello all; thanks for taking this little questions. I am a novice with
SAS, but have a steep learning curve. I have tried to print a list of
all variables with their labels and format type (char or num, etc) in
my database using the PROC CONTENTS function. What it does not place in
this output is a list of VALUE LABELS (e.g for variable Gender: Values
1, 2: Value labels 1-FEMALE 2-MALE); Yes, I have these value labels in
the database that are in 'lookup tables', that I created using EpiInfo
V3.2.2 (MSAccess backend). My question is: how do I get SAS PROC
CONTENTS print these value labels out, so that I have a comprehensive
CODEBOOK ready for use. My workaround this difficulty is to print using
PROC CONTENTS as RTF using ODS output style; then adding a column for
Value Labels and manually enter these for all variables that have been
entered 'comment legal' values.

Many thanks once again.
Best wishes,
Shuaib

sas >> Print a list of all variables, format, labels and value labels

by skauchali » Tue, 17 May 2005 02:11:26 GMT

Thanks both Howard and Bob.
Bob: Could you give me an example of a code to use.

Many thanks.
SK

Similar Threads

1. Getting TTEST (and other PROCS) to print variable labels

2. Getting TTEST (and other PROCS) to print variable labels instead

Hi

I looked at the documentation for TTEST and googled a bit, but didn't see a way to get PROC TTEST to print variable labels instead of variable names.  People at my current place of employment are fond of giving variables names like VAR1, and then using labels.

They've been collecting data for 30 years, so they aren't going to change (and there's no way to change all the data sets they have).

So, is there a way to get PROC TTEST to do this?
Is there general guidance on how to make SAS PROCs print labels instead of variable names?

TIA as always

Peter

3. PROC PRINT: Hide variables names (labels) ???

4. How to label plot lines in GPLOT with a variable value

Hi, All

I have a PROC GPLOT that is producing overlay plots with by-groups. The
input data has other numeric fields (not being plotted) the values of
which are always the same for every observation within a by-group. I
would like to print these values on the plot as labels of the plot
lines.=20

To make it clear what I'm doing here the numbers I'm plotting are
estimated values produced by PROC REG and the would-be label values are
R-Squared statistics merged in from an OUTEST dataset. The output I want
to get is similar to "trendlines" in (you should pardon the expression)
Excel where you can label the trendlines with the R-Squared number.=20

This is a sample of the data. App_cdode and m form the by-group. Linear
and polynomial are the estimates I'm plotting. Rsqlin and rsqpoly are
the corresponding stats.

Obs    app_code      m        G        linear    polynomial     rsqlin
rsqpoly

 1      2W00      JUL07      100       94.298       94.298     0.44802
0.44802
 2      2W00      AUG07      100       96.373       96.373     0.44802
0.44802
 3      2W00      SEP07      100       98.448       98.448     0.44802
0.44802
 4      2W00      OCT07      100      100.456      100.456     0.44802
0.44802
 5      2W00      NOV07      100      102.531      102.531     0.44802
0.44802
 6      2W00      DEC07      100      104.539      104.539     0.44802
0.44802
 7      2W00      JAN08      100      106.614      106.614     0.44802
0.44802
 8      2W00      FEB08      100      108.689      108.689     0.44802
0.44802
 9      2W00      MAR08      100      110.631      110.631     0.44802
0.44802
10      2W00      APR08      125      112.706      112.706     0.44802
0.44802
11      2W00      MAY08      125      114.714      114.714     0.44802
0.44802
12      2W00      JUN08        .      116.789      116.789     0.44802
0.44802
13      2W00      JUL08        .      118.797      118.797     0.44802
0.44802
14      2W00      AUG08        .      120.872      120.872     0.44802
0.44802
15      2W00      SEP08        .      122.947      122.947     0.44802
0.44802
16      2W00      OCT08        .      124.955      124.955     0.44802
0.44802=20

TIA

-Jim Lane
_______________________________________________________________________

This e-mail may be privileged and/or confidential, and the sender does not =
waive any related rights and obligations.
Any distribution, use or copying of this e-mail or the information it conta=
ins by other than an intended recipient is unauthorized.
If you received this e-mail in error, please advise me (by return e-mail or=
 otherwise) immediately. =20

Ce courrier =E9lectronique est confidentiel et prot=E9g=E9. L'exp=E9diteur =
ne renonce pas aux droits et obligations qui s'y rapportent.
Toute diffusion, utilisation ou copie de ce message ou des renseignements q=
u'il contient par une personne autre que le (les) destinataire(s) d=E9sign=
=E9(s) est interdite.
Si vous recevez ce courrier =E9lectronique par erreur, veuillez m'en aviser=
 imm=E9diatement, par retour de courrier =E9lectronique ou par un autre moy=
en.

5. Converting a SPSS file to SAS with Value and Variable labels

6. Labels ....Labels

Hi all,

I'm using a dataset in which the variables have long labels. Now I
want that in the output instead of the complete label only the first
three words of the label be showed.
Is that possible? And also is their away to show only the labels and
not the variable name?

Thanks,
Sajeel

7. capturing the value of a variable LABEL

8. Value of a variable as label

Hey all,

Is it possible in one data step to use the value of a variable as label for
another one?

for example;

data _test;
input var label;
datalines;
3 g/L
;
run;

i want to use the value of variable label (g/L) as label for the variable
var!

best regards,



Majd A.I. Mirza, Ph.D.student
Dept. of Medical Sciences
Uppsala University Hospital
S-751 85  Uppsala
Phone: +46 (18) 611 49 02
Cell: +46 (736) 000 128
Fax: +46 (18) 500 952