Date: Fri, 14 Mar 1997 08:26:10 GMT
Reply-To: Andrew James Llwellyn Cary <ajlcary@IX.NETCOM.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Andrew James Llwellyn Cary <ajlcary@IX.NETCOM.COM>
Organization: Cary Consulting Services
Subject: Re: put those var labels?
First off, you could try using data step arrays rather then using a macro to
generate SAS code:
data _null_;
set test;
file 'test' print ps=20 ls=80 header=newpage;
put (id reg1-reg40) (10.0 40*11.6);
return;
newpage:
array reg [40] reg1-reg40;
length reglabel $40;
put ' ID'@;
do _i=1 to 40 ;
call label(reg[_i],reglabel);
put +1 reglabel $10. @;
end;
put ;
return;
run;
Douglas Nichols <dnichols@fhcrc.org> wrote in article
<01bc3016$5bd523c0$1a736b8c@pc19675>...
> I am trying to do a simple data _null_ that will print out a series of
> values
> calculated earlier and would like to put the variabel labels above. This,
> maybe just now, seems not to simple although I thought it would be. I am
> thinking that the step looks something like this
>
> where vmin and vmax are the starting and ending numbers for the variabels
>
> ....assign variables labels as I go.....
>
> labels look like this
> reg1 = ee4a, reg2 = dd4a,... etc....
>
> %let spot = 40;
> %let tspot = 40;
> %macro getlab();
> %do i = &vmin %to &vmax;
> %let loc = %eval(&spot + &i*10);
> call label(reg&i,lab); /* variable names are like reg1-reg10 */
> /* i suppose lab would contain the labels */
> put @&loc lab @;
> %end;
> put ;
> %let tspot = %eval(&loc + 10);
> %mend getlab;
>
>
> data _null_;
> format dtox convfmt.;
> set ffinal;
> file print;
> by tox dtox;
> if _n_ eq 1 then link headit;
> if first.tox then put @2 tox @;
> ... put some values.....
> return;
> headit:
> %getlab
> put @2 "Toxicity" @30 "Degree" @;
> put @2 &tspot*"-";
> return;
> run;
>
> So if you have some input thanks!
>
> dn
>
|