diff --git a/.gitignore b/.gitignore index 0c208466..43769503 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ mc_* *.env* ~ +.gitattributes diff --git a/all.sas b/all.sas index 651a10c6..1b4c2ae3 100644 --- a/all.sas +++ b/all.sas @@ -14552,7 +14552,7 @@ run; %else %if &engine=ODBC %then %do; &mD.%put NOTE: Retrieving ODBC connection details; data _null_; - length connx_uri conprop_uri value datasource up_uri schema $256.; + length connx_uri conprop_uri value datasource up_uri schema domprop_uri authdomain $256.; call missing (of _all_); /* get source connection ID */ rc=metadata_getnasn("&liburi",'LibraryConnection',1,connx_uri); @@ -14567,6 +14567,13 @@ run; rc2=-1; end; end; + + /* get auth domain */ + autrc=metadata_getnasn(connx_uri,"Domain",1,domprop_uri); + arc=metadata_getattr(domprop_uri,"Name",authdomain); + if not missing(authdomain) then authdomain=cats('AUTHDOMAIN=',authdomain); + call symputx('authdomain',authdomain,'l'); + /* get SCHEMA */ rc6=metadata_getnasn("&liburi",'UsingPackages',1,up_uri); rc7=metadata_getattr(up_uri,'SchemaName',schema); @@ -14583,7 +14590,7 @@ run; (INSERT_SQL=YES DATASRC=&sql_dsn. CONNECTION=global); %end; %else %do; - libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema; + libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema &authdomain; %end; %end; %else %if &engine=POSTGRES %then %do; diff --git a/meta/mm_assigndirectlib.sas b/meta/mm_assigndirectlib.sas index 7ac378fe..b1f1d957 100755 --- a/meta/mm_assigndirectlib.sas +++ b/meta/mm_assigndirectlib.sas @@ -212,7 +212,7 @@ run; %else %if &engine=ODBC %then %do; &mD.%put NOTE: Retrieving ODBC connection details; data _null_; - length connx_uri conprop_uri value datasource up_uri schema $256.; + length connx_uri conprop_uri value datasource up_uri schema domprop_uri authdomain $256.; call missing (of _all_); /* get source connection ID */ rc=metadata_getnasn("&liburi",'LibraryConnection',1,connx_uri); @@ -227,6 +227,13 @@ run; rc2=-1; end; end; + + /* get auth domain */ + autrc=metadata_getnasn(connx_uri,"Domain",1,domprop_uri); + arc=metadata_getattr(domprop_uri,"Name",authdomain); + if not missing(authdomain) then authdomain=cats('AUTHDOMAIN=',authdomain); + call symputx('authdomain',authdomain,'l'); + /* get SCHEMA */ rc6=metadata_getnasn("&liburi",'UsingPackages',1,up_uri); rc7=metadata_getattr(up_uri,'SchemaName',schema); @@ -243,7 +250,7 @@ run; (INSERT_SQL=YES DATASRC=&sql_dsn. CONNECTION=global); %end; %else %do; - libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema; + libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema &authdomain; %end; %end; %else %if &engine=POSTGRES %then %do;