Tom, No luck
this is my code:
%macro test(DSN):
proc sql;
create connection to ORACLE ,,,,,,,
create table employee_&DSN. as
select * from .&DSN. a
left join employee e
on a.id = e.id;
run;
%mend test;
%test(FILE1,FILE2)
quit;
getting errors:
more positional parameters found than defined
please advise and let me know the issue. Thank
It is a common beginners problem to try and use SAS Macro language for a problem that should be addressed differently. It's much better to first better skill up in normal SAS language before even attempting to use SAS Macro language.
I believe we could give you better advice if you can tell us what bigger problem you want to solve. Share the bigger picture with us? What do you have to start with, what do you need as target state and where you're stuck and need help with? - A description of the problem like: A bunch of SAS tables in a source library to be loaded into same named tables in Oracle. Dynamic code required to just pick-up whatever tables are in source. Succeeded to write the load code for a single table but don't manage to make the code dynamic.
@karachi007 wrote:
Tom, No luck
this is my code:
%macro test(DSN):
proc sql;
create connection to ORACLE ,,,,,,,
create table employee_&DSN. as
select * from .&DSN. a
left join employee e
on a.id = e.id;
run;
%mend test;
%test(FILE1,FILE2)
quit;
getting errors:
more positional parameters found than defined
please advise and let me know the issue. Thank
The ERROR message is very clear and obvious: you defined the macro with only ONE parameter, and then tried to call it with TWO parameters. This is not possible.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.