*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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.