I have created a macro that creates a new table based on an SQL procedure that pulls data from some SQL tables. This macro is below and works without any problems as expected:
%macro Pull_Data_from_db(database, server, portid, tblname);
%let libraryname = db;
connect to oledb (init_string="Provider=SQLOLEDB; Integrated Security=SSPI; Initial Catalog=&database.; data source=&server." schema=dbo);
create table &tblname. as select * from connection to oledb (
I next want to create a macro that will take this macro putting it into a loop and run it on multiple tables. So far I have put the function into a new function and tried running it in that function and rather than just connecting I get a pop up asking to specify Data Link Properties.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.