mirror of
https://github.com/sasjs/core.git
synced 2026-01-19 14:30:05 +00:00
added authdomain for odvc engine
This commit is contained in:
@@ -31,41 +31,41 @@
|
||||
@version 9.2
|
||||
@author Allan Bowe
|
||||
|
||||
**/
|
||||
**/
|
||||
|
||||
%macro mm_assigndirectlib(
|
||||
%macro mm_assigndirectlib(
|
||||
libref
|
||||
,open_passthrough=
|
||||
,sql_options=
|
||||
,mDebug=0
|
||||
,mAbort=0
|
||||
)/*/STORE SOURCE*/;
|
||||
)/*/STORE SOURCE*/;
|
||||
|
||||
%local mD;
|
||||
%if &mDebug=1 %then %let mD=;
|
||||
%else %let mD=%str(*);
|
||||
%&mD.put Executing mm_assigndirectlib.sas;
|
||||
%&mD.put _local_;
|
||||
%local mD;
|
||||
%if &mDebug=1 %then %let mD=;
|
||||
%else %let mD=%str(*);
|
||||
%&mD.put Executing mm_assigndirectlib.sas;
|
||||
%&mD.put _local_;
|
||||
|
||||
%if &mAbort=1 %then %let mAbort=;
|
||||
%else %let mAbort=%str(*);
|
||||
%if &mAbort=1 %then %let mAbort=;
|
||||
%else %let mAbort=%str(*);
|
||||
|
||||
%&mD.put NOTE: Creating direct (non META) connection to &libref library;
|
||||
%&mD.put NOTE: Creating direct (non META) connection to &libref library;
|
||||
|
||||
%local cur_engine;
|
||||
%let cur_engine=%mf_getengine(&libref);
|
||||
%if &cur_engine ne META and &cur_engine ne %then %do;
|
||||
%local cur_engine;
|
||||
%let cur_engine=%mf_getengine(&libref);
|
||||
%if &cur_engine ne META and &cur_engine ne %then %do;
|
||||
%put NOTE: &libref already has a direct (&cur_engine) libname connection;
|
||||
%return;
|
||||
%end;
|
||||
%else %if %upcase(&libref)=WORK %then %do;
|
||||
%end;
|
||||
%else %if %upcase(&libref)=WORK %then %do;
|
||||
%put NOTE: We already have a direct connection to WORK :-) ;
|
||||
%return;
|
||||
%end;
|
||||
%end;
|
||||
|
||||
/* need to determine the library ENGINE first */
|
||||
%local engine;
|
||||
data _null_;
|
||||
/* need to determine the library ENGINE first */
|
||||
%local engine;
|
||||
data _null_;
|
||||
length lib_uri engine $256;
|
||||
call missing (of _all_);
|
||||
/* get URI for the particular library */
|
||||
@@ -75,10 +75,10 @@
|
||||
putlog "mm_assigndirectlib for &libref:" rc1= lib_uri= rc2= engine=;
|
||||
call symputx("liburi",lib_uri,'l');
|
||||
call symputx("engine",engine,'l');
|
||||
run;
|
||||
run;
|
||||
|
||||
/* now obtain engine specific connection details */
|
||||
%if &engine=BASE %then %do;
|
||||
/* now obtain engine specific connection details */
|
||||
%if &engine=BASE %then %do;
|
||||
%&mD.put NOTE: Retrieving BASE library path;
|
||||
data _null_;
|
||||
length up_uri $256 path cat_path $1024;
|
||||
@@ -112,8 +112,8 @@
|
||||
libname &libref &filepath filelockwait=5;
|
||||
%end;
|
||||
|
||||
%end;
|
||||
%else %if &engine=REMOTE %then %do;
|
||||
%end;
|
||||
%else %if &engine=REMOTE %then %do;
|
||||
data x;
|
||||
length rcCon rcProp rc k 3 uriCon uriProp PropertyValue PropertyName
|
||||
Delimiter $256 properties $2048;
|
||||
@@ -143,9 +143,9 @@
|
||||
|
||||
libname &libref &engine &properties slibref=&libref;
|
||||
|
||||
%end;
|
||||
%end;
|
||||
|
||||
%else %if &engine=OLEDB %then %do;
|
||||
%else %if &engine=OLEDB %then %do;
|
||||
%&mD.put NOTE: Retrieving OLEDB connection details;
|
||||
data _null_;
|
||||
length domain datasource provider properties schema
|
||||
@@ -208,11 +208,11 @@
|
||||
%end;
|
||||
connection=shared;
|
||||
%end;
|
||||
%end;
|
||||
%else %if &engine=ODBC %then %do;
|
||||
%end;
|
||||
%else %if &engine=ODBC %then %do;
|
||||
&mD.%put NOTE: Retrieving ODBC connection details;
|
||||
data _null_;
|
||||
length domprop_uri authdomain 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);
|
||||
@@ -226,7 +226,6 @@
|
||||
rc4=metadata_getattr(conprop_uri,'DefaultValue',datasource);
|
||||
rc2=-1;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
/* get auth domain */
|
||||
@@ -237,7 +236,7 @@
|
||||
/* get SCHEMA */
|
||||
rc6=metadata_getnasn("&liburi",'UsingPackages',1,up_uri);
|
||||
rc7=metadata_getattr(up_uri,'SchemaName',schema);
|
||||
&mD.put rc= connx_uri= rc2= conprop_uri= rc3= value= rc4= autrc= arc= datasource=
|
||||
&mD.put rc= connx_uri= rc2= conprop_uri= rc3= value= rc4= datasource=
|
||||
rc6= up_uri= rc7= schema=;
|
||||
|
||||
call symputx('SQL_schema',schema,'l');
|
||||
@@ -252,8 +251,8 @@
|
||||
%else %do;
|
||||
libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema AUTHDOMAIN=&authdomain;
|
||||
%end;
|
||||
%end;
|
||||
%else %if &engine=POSTGRES %then %do;
|
||||
%end;
|
||||
%else %if &engine=POSTGRES %then %do;
|
||||
%put NOTE: Obtaining POSTGRES library details;
|
||||
data _null_;
|
||||
length database ignore_read_only_columns direct_exe preserve_col_names
|
||||
@@ -351,8 +350,8 @@
|
||||
&preserve_col_names &preserve_tab_names &server &schema &authdomain
|
||||
&user &password;
|
||||
%end;
|
||||
%end;
|
||||
%else %if &engine=ORACLE %then %do;
|
||||
%end;
|
||||
%else %if &engine=ORACLE %then %do;
|
||||
%put NOTE: Obtaining &engine library details;
|
||||
data _null_;
|
||||
length assocuri1 assocuri2 assocuri3 authdomain path schema $256;
|
||||
@@ -379,8 +378,8 @@
|
||||
%put NOTE- authdomain=&authdomain;
|
||||
%put NOTE-;
|
||||
libname &libref ORACLE path=&path schema=&schema authdomain=&authdomain;
|
||||
%end;
|
||||
%else %if &engine=SQLSVR %then %do;
|
||||
%end;
|
||||
%else %if &engine=SQLSVR %then %do;
|
||||
%put NOTE: Obtaining &engine library details;
|
||||
data _null;
|
||||
length assocuri1 assocuri2 assocuri3 authdomain path schema userid
|
||||
@@ -411,8 +410,8 @@
|
||||
%put NOTE-;
|
||||
|
||||
libname &libref SQLSVR datasrc=&path schema=&schema user="&user" pass="&pass";
|
||||
%end;
|
||||
%else %if &engine=TERADATA %then %do;
|
||||
%end;
|
||||
%else %if &engine=TERADATA %then %do;
|
||||
%put NOTE: Obtaining &engine library details;
|
||||
data _null;
|
||||
length assocuri1 assocuri2 assocuri3 authdomain path schema userid
|
||||
@@ -451,18 +450,18 @@
|
||||
%put NOTE-;
|
||||
|
||||
libname &libref TERADATA server="&path" schema=&schema authdomain=&authdomain;
|
||||
%end;
|
||||
%else %if &engine= %then %do;
|
||||
%end;
|
||||
%else %if &engine= %then %do;
|
||||
%put NOTE: Libref &libref is not registered in metadata;
|
||||
%&mAbort.mp_abort(
|
||||
msg=%str(ERR)OR: Libref &libref is not registered in metadata
|
||||
,mac=mm_assigndirectlib.sas);
|
||||
%return;
|
||||
%end;
|
||||
%else %do;
|
||||
%end;
|
||||
%else %do;
|
||||
%put %str(WARN)ING: Engine &engine is currently unsupported;
|
||||
%put %str(WARN)ING- Please contact your support team.;
|
||||
%return;
|
||||
%end;
|
||||
%end;
|
||||
|
||||
%mend mm_assigndirectlib;
|
||||
%mend mm_assigndirectlib;
|
||||
|
||||
Reference in New Issue
Block a user