<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Specifying Data Link Properties for an SQL query in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Specifying-Data-Link-Properties-for-an-SQL-query/m-p/300013#M60488</link>
    <description>&lt;P&gt;&amp;nbsp;I have created a macro that creates a new table based on an SQL procedure that pulls data from some&amp;nbsp;SQL tables. This macro is below and works without any problems as expected:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%macro Pull_Data_from_db(database, server, portid, tblname);

	%let libraryname = db;
	
proc sql;
	
	connect to oledb (init_string="Provider=SQLOLEDB; Integrated Security=SSPI; Initial Catalog=&amp;amp;database.; data source=&amp;amp;server." schema=dbo);
			create table &amp;amp;tblname. as select * from connection to oledb (

	SQL code;
quit;
%mend;&lt;/PRE&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%macro Pull_Multi_tables_from_db(database, server, portid, tblname);

	%Pull_Data_from_EDM(database, server, portid, tblname);

%mend;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a reason my macro is able to connect properly when run by itself but not when put into a second macro?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Sep 2016 23:59:23 GMT</pubDate>
    <dc:creator>chris_e</dc:creator>
    <dc:date>2016-09-21T23:59:23Z</dc:date>
    <item>
      <title>Specifying Data Link Properties for an SQL query</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Specifying-Data-Link-Properties-for-an-SQL-query/m-p/300013#M60488</link>
      <description>&lt;P&gt;&amp;nbsp;I have created a macro that creates a new table based on an SQL procedure that pulls data from some&amp;nbsp;SQL tables. This macro is below and works without any problems as expected:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%macro Pull_Data_from_db(database, server, portid, tblname);

	%let libraryname = db;
	
proc sql;
	
	connect to oledb (init_string="Provider=SQLOLEDB; Integrated Security=SSPI; Initial Catalog=&amp;amp;database.; data source=&amp;amp;server." schema=dbo);
			create table &amp;amp;tblname. as select * from connection to oledb (

	SQL code;
quit;
%mend;&lt;/PRE&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%macro Pull_Multi_tables_from_db(database, server, portid, tblname);

	%Pull_Data_from_EDM(database, server, portid, tblname);

%mend;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a reason my macro is able to connect properly when run by itself but not when put into a second macro?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 23:59:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Specifying-Data-Link-Properties-for-an-SQL-query/m-p/300013#M60488</guid>
      <dc:creator>chris_e</dc:creator>
      <dc:date>2016-09-21T23:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying Data Link Properties for an SQL query</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Specifying-Data-Link-Properties-for-an-SQL-query/m-p/300014#M60489</link>
      <description>&lt;P&gt;Sorry just realised I needed to put &amp;amp; on the front of the variables and . on the end in the second function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%macro Pull_Multi_tables_from_db(database, server, portid, tblname);

	%Pull_Data_from_EDM(&amp;amp;database., &amp;amp;server., &amp;amp;portid., &amp;amp;tblname.);

%mend;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Sep 2016 00:15:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Specifying-Data-Link-Properties-for-an-SQL-query/m-p/300014#M60489</guid>
      <dc:creator>chris_e</dc:creator>
      <dc:date>2016-09-22T00:15:19Z</dc:date>
    </item>
  </channel>
</rss>

