*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
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.