Date: Thu, 14 Jul 2005 17:50:19 -0400
Reply-To: Arthur Tabachneck <art297@NETSCAPE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@NETSCAPE.NET>
Subject: Re: SIMPLE MACRO QUESTION: THANKS and follow-up
Kevin,
Hopefully, the following will provide a sufficient example of how you can
use proc sql to obtain labels from SASHELP.VCOLUMN and put them into macro
variables.
Art
data dataset1;
input id 1-3 q1 5-5 q2 7-7 q3 9-9 q4 11-11 q5 13-13;
label
q1 = 'Landfill'
q2 = 'Mall'
q3 = 'Willingness'
q4 = 'Gender'
q5 = 'Income';
datalines;
001 1 2 1 1 4
002 1 1 1 2 3
003 4 4 2 1 2
004 2 3 1 1 4
005 1 1 1 1 1
006 1 1 1 1 4
007 2 2 2 2 1
run;
PROC SQL noprint;
select label into :L1-:L5
from SASHELP.VCOLUMN
where
upcase(libname) = "WORK"
and upcase(memname) = "DATASET1"
and upcase(name) in ('Q1','Q2','Q3','Q4','Q5');
quit;
%put &L1;
%put &L2;
%put &L3;
%put &L4;
%put &L5;
--------------
On Thu, 14 Jul 2005 16:43:24 -0400, Kevin F. Spratt
<Kevin.F.Spratt@DARTMOUTH.EDU> wrote:
>Now: how could i get the labels associated with the predictors into the
>titles?
>
>I know, always pushing for more!
|