*Working code...;
Everything @LinusH and @RW9 said.
...but what certainly will throw an error is a "run" statement in the middle of a data step
*Macro code generating error;
%macro multiresponse (ds=);
Data &ds.....
set test;
.....
run;
array a (*) &ds_1-&ds_8;
.....
run;
end;
%mend;
...oh... and an "end" which is not an "%end" after a "run" statement.
What you probably should do: Make your data step work as a sample outside of a macro and only "macrotize" it once it works.
So, what's the error?
Hi,
Lets take a step back. Post some test data:
https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...
With what you have, and show an example of what you want the output to look like. Most of that code posted there looks to be redundant, but until I see input/output its hard to say.
Everything @LinusH and @RW9 said.
...but what certainly will throw an error is a "run" statement in the middle of a data step
*Macro code generating error;
%macro multiresponse (ds=);
Data &ds.....
set test;
.....
run;
array a (*) &ds_1-&ds_8;
.....
run;
end;
%mend;
...oh... and an "end" which is not an "%end" after a "run" statement.
What you probably should do: Make your data step work as a sample outside of a macro and only "macrotize" it once it works.
Thank you.
In addition, note that your definition of the elements in the array A is incorrect. The array B is correct, but A should use similar syntax:
&ds._1 - &ds._2
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.