|
Is it possible to dynamically include some code into a datatep based
on a dataset variable?
Using 9.1.3 on Sun Solaris
Something like this.
filename c1 '/path/code1.sas';
filename c2 '/path/code2.sas';
filename c3 '/path/code3.sas';
data codes;
code='c1'; output;
code='c2'; output;
code='c3'; output;
run;
data process;
set codes;
/* So here CODE resolves to be c1, c2 etc and this in turn points to
code1.sas etc */
%include code;
run;
I have been challenged to make a program more efficient and at the
moment it contains a step that currently resembles this:
data process;
set codes;
if code='c1' then %include c1;
else if code='c2' then etc...;
.
.
else if code='C107' then etc;
But there are hundreds of unique code values and the codes dataset
contains tens of millions of rows...
Any ideas?
Many thanks.
|