@sasjs/core 4.60.1 → 4.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,8 +25,9 @@
25
25
  %local dsid vnum rc schema;
26
26
  /* in case the parameter is a libref.tablename, pull off just the libref */
27
27
  %let libref = %upcase(%scan(&libref, 1, %str(.)));
28
+ /* sysname can be 'Schema/Owner' or just 'Schema' (eg snowflake) */
28
29
  %let dsid=%sysfunc(open(sashelp.vlibnam(where=(
29
- libname="%upcase(&libref)" and sysname='Schema/Owner'
30
+ libname="%upcase(&libref)" and sysname=:'Schema'
30
31
  )),i));
31
32
  %if (&dsid ^= 0) %then %do;
32
33
  %let vnum=%sysfunc(varnum(&dsid,SYSVALUE));
@@ -213,7 +213,8 @@ run;
213
213
  %else %if &engine=ODBC %then %do;
214
214
  %&mD.put NOTE: Retrieving ODBC connection details;
215
215
  data _null_;
216
- length connx_uri conprop_uri value datasource up_uri schema domprop_uri authdomain $256.;
216
+ length connx_uri conprop_uri value datasource up_uri schema domprop_uri
217
+ authdomain $256.;
217
218
  call missing (of _all_);
218
219
  /* get source connection ID */
219
220
  rc=metadata_getnasn("&liburi",'LibraryConnection',1,connx_uri);
@@ -413,6 +414,55 @@ run;
413
414
 
414
415
  libname &libref SQLSVR datasrc=&path schema=&schema user="&user" pass="&pass";
415
416
  %end;
417
+ %else %if &engine=SASIOSNF or &engine=SNOW %then %do;
418
+ %&mD.put NOTE: Retrieving SNOW connection details;
419
+ data _null_;
420
+ length connx_uri conprop_uri value server up_uri schema domprop_uri
421
+ authdomain database $256.;
422
+ call missing (of _all_);
423
+ /* get source connection ID */
424
+ rc=metadata_getnasn("&liburi",'LibraryConnection',1,connx_uri);
425
+ /* get connection properties */
426
+ i=0;
427
+ do until (rc2<0);
428
+ i+1;
429
+ rc2=metadata_getnasn(connx_uri,'Properties',i,conprop_uri);
430
+ rc3=metadata_getattr(conprop_uri,'Name',value);
431
+ if value='Connection.DBMS.Property.SERVER.Name.xmlKey.txt' then do;
432
+ rc4=metadata_getattr(conprop_uri,'DefaultValue',server);
433
+ rc2=-1;
434
+ end;
435
+ end;
436
+
437
+ /* get auth domain */
438
+ autrc=metadata_getnasn(connx_uri,"Domain",1,domprop_uri);
439
+ arc=metadata_getattr(domprop_uri,"Name",authdomain);
440
+ if not missing(authdomain) then authdomain=cats('AUTHDOMAIN=',authdomain);
441
+ call symputx('authdomain',authdomain,'l');
442
+
443
+ /* get SCHEMA */
444
+ rc6=metadata_getnasn("&liburi",'UsingPackages',1,up_uri);
445
+ rc7=metadata_getattr(up_uri,'SchemaName',schema);
446
+ &mD.put rc= connx_uri= rc2= conprop_uri= rc3= value= rc4= server=
447
+ rc6= up_uri= rc7= schema=;
448
+
449
+ /* get database value */
450
+ prop='Connection.DBMS.Property.DB.Name.xmlKey.txt';
451
+ rc=metadata_getprop("&liburi",prop,database,"");
452
+ if database^='' then database='database='!!quote(trim(database));
453
+ call symputx('database',database,'l');
454
+
455
+ call symputx('snow_schema',schema,'l');
456
+ call symputx('snow_server',server,'l');
457
+ run;
458
+
459
+ libname &libref SNOW SERVER="&snow_server" SCHEMA=&snow_schema &authdomain
460
+ &database;
461
+ %if %length(&open_passthrough)>0 %then %do;
462
+ proc sql;
463
+ connect using &libref as &open_passthrough;
464
+ %end;
465
+ %end;
416
466
  %else %if &engine=TERADATA %then %do;
417
467
  %put NOTE: Obtaining &engine library details;
418
468
  data _null;
package/package.json CHANGED
@@ -32,5 +32,5 @@
32
32
  "lint": "npx @sasjs/cli lint",
33
33
  "prepare": "git rev-parse --git-dir && git config core.hooksPath ./.git-hooks || true"
34
34
  },
35
- "version": "4.60.1"
35
+ "version": "4.62.0"
36
36
  }