Date: Fri, 7 May 2010 11:01:40 -0500
Reply-To: "Data _null_;" <iebupdte@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Data _null_;" <iebupdte@GMAIL.COM>
Subject: Re: PROC MEANS printout without printing variable name?
In-Reply-To: <35609.150.142.232.4.1273247412.squirrel@webmail.albany.edu>
Content-Type: text/plain; charset=ISO-8859-1
What if the label is longer than 32 characters. Does VALIDVARNAME=ANY
imply any var name LENGTH?
On 5/7/10, Mike Zdeb <msz03@albany.edu> wrote:
> hi ... here's an "automated" follow up to the RENAME suggestion (that was pretty neat)
>
> data x;
> input name : $4. sbp dbp;
> label
> sbp = 'SYSTOLIC BLOOD PRESSURE'
> dbp = 'DIASTLIC BLOOD PRESSURE'
> ;
> datalines;
> MIKE 120 80
> IGOR 250 100
> run;
>
> proc sql noprint;
> select catt(name,'="',label,'"n') into :rename separated by ' '
> from dictionary.columns
> where libname eq 'WORK' and memname eq 'X' and type eq 'num';
> quit;
>
> * allow NAMED variables;
> options validvarname=any;
>
> * rename the numeric variables with their labels, get rid of the labels;
> data y;
> set x;
> rename &rename;
> attrib _all_ label=' ';
> run;
>
> proc means data=y;
> run;
>
> * back to defaults;
> options validvarname=v7;
>
>
> OUTPUT ...
>
> Variable N Mean Std Dev Minimum Maximum
> SYSTOLIC BLOOD PRESSURE 2 185.0000000 91.9238816 120.0000000 250.0000000
> DIASTLIC BLOOD PRESSURE 2 90.0000000 14.1421356 80.0000000 100.0000000
>
>
> --
> Mike Zdeb
> U@Albany School of Public Health
> One University Place (Room 119)
> Rensselaer, New York 12144-3456
> P/518-402-6479 F/630-604-1475
>
> >> -----Original Message-----
> >> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of SUBSCRIBE SAS-L JingJu11 S
> >> Sent: Friday, May 07, 2010 9:07 AM
> >> To: SAS-L@LISTSERV.UGA.EDU
> >> Subject: Re: PROC MEANS printout without printing variable name?
> >>
> >> If you print listing output directly, I think you are not able(at least
> >> very hard ) to suppress the variable name.On the other hand, if you really
> >> need the label and the label is no more than 32 characters, you can try:
> >>
> >> options validvarname = any;
> >> ods pdf;
> >> proc means data = a(rename = (x = 'Label of x'n));
> >> var 'Label of x'n;
> >> run;
> >> ods _all_ close;
> >> ods listing;
> >> options validvarname = v7;
> >>
> >> Here you did not suppress variable name but replace it by a same-as-label
> >> variable name.
> >>
> >
>
|