|
JSD,
You really want that length stashed in a macro variable. Try this.
proc sql;
reset noprint;
select max( overall_length ) into :MAXLEN
from formatting
;
quit;
data mydata;
set in;
length my_var $&MAXLEN.;
my_var = my_other_var;
run;
HTH - Jack
-----Original Message-----
From: JSD
To: SAS-L@LISTSERV.UGA.EDU
Sent: 6/24/02 4:05 PM
Subject: Using a var value in a subsequent data step
Greetings,
I am stuck on particular block of code. Here is a snippet of some
code that I am currently working with.
/**********************************************************
proc means data=formatting;
var overall_length;
output out=formatting2 max(overall_length) =
max_length;
run;
quit;
data mydata;
length myvar $max_length.; /* <- stuck here */
set formatting2;
myvar = my_other_var;
run;
quit;
************************************************************/
I get hung up in the data step. In the above proc the "max_length"
var in the formatting2 data set will be of variable length. I would
like to adjust the length of "myvar" to the value of the "max_length"
var.
For example, if the value of the "max_length" var was 27,
the length arument in the subsequent data step would be $27.
Any help or suggestions would be appreciated.
Thanks,
JSD
[text/html]
|