Foreword: Call execute is a function that can be used if you want to run some code based on the values of a dataset. In the example below the dataset test1 is only created if there is someone whose age = 100 in the dataset test:
[code:c445c]
data _null_;
set test;
if age=100 then do;
call execute("data test1;set test;run;");
stop;
end;
else stop;
run; [/code:c445c]
So in the example above the code that would be run if an age is =100 is:
[code:c445c]data _null_;
set test;
if age=100 then do;
call execute("data test1;set test;run;");
stop;
end;
else stop;
run;
data test1;
set test;
run; [/code:c445c]
Or a macro could be called:
[code:c445c]data _null_;
set test;
if age=100 then do;
call execute(%testmac);
stop;
end;
else stop;
run;[/code:c445c]