BookmarkSubscribeRSS Feed
jjyy123
Calcite | Level 5

SAS version: SAS 9.4

 

OS: Windows 10

 

Problem: I've setup the SAS Workspace Server on a remote vm, and I want to use jdbc locally to query `sashelp.Vslib` data set in remote workspace server from to get all the meta info (how many libraries in remote workspace server, including library name and path). I've set the driver property to `com.sas.rio.MVADriver` and installed all required dependencies.

I can successfully get connected to remote workspace server and do normal query. However, When querying `sashelp.Vslib` data set, I can only get the SAS pre-defined library:

cells: "MAPS"
cells: "C:\\Program Files\\SASHome\\SASFoundation\\9.4\\maps"
, cells: "MAPSGFK"
cells: "C:\\Program Files\\SASHome\\SASFoundation\\9.4\\mapsgfk"
, cells: "MAPSSAS"
cells: "C:\\Program Files\\SASHome\\SASFoundation\\9.4\\maps"
, cells: "SASDATA"
cells: "C:\\Program Files\\SASHome\\SASFoundation\\9.4\\core\\sashelp"
, cells: "SASHELP"
cells: "( \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\nls\\en\\SASCFG\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\core\\sashelp\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\aacomp\\sashelp\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\af\\sashelp\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\assist\\sashelp\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\cas\\sashelp\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\cmp\\sashelp\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\connect\\sashelp\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\dmine\\sashelp\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\eis\\sashelp\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\ets\\sashelp\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\genetics\\sashelp\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\gis\\sashelp\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\graph\\sashelp\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\iml\\sashelp\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\intrnet\\sashelp\' \'C:\\Program Files\\SASHome\\SASFoundation\\9.4\\inttech\\sashelp\' \'C:\\Program Files\\SASHom"
, cells: "SASUSER"
cells: "C:\\Users\\heliostest\\Documents\\My SAS Files\\9.4"
, cells: "STPSAMP"
cells: "C:\\Program Files\\SASHome\\SASFoundation\\9.4\\inttech\\sample"
, cells: "WORK"
cells: "C:\\Users\\HELIOS~1\\AppData\\Local\\Temp\\SAS Temporary Files\\_TD3960_DESKTOP-CU59CJJ_\\Prc2"

 

 And my self-created library `MYLIB` and `RFGEY` are missing, although they are truly in the vslib data set:

Screen Shot 2020-01-03 at 17.20.25.png
If I use PROC SQL to query sashelp.Vslib inside SAS Editor, I can also get all the libraries:

proc sql;
select * from sashelp.vslib;
QUIT;

 

 

The SAS System

 

Library Name

Pathname

MAPS

C:\Program Files\SASHome\SASFoundation\9.4\maps

MAPSGFK

C:\Program Files\SASHome\SASFoundation\9.4\mapsgfk

MAPSSAS

C:\Program Files\SASHome\SASFoundation\9.4\maps

MYLIB

C:\Users\heliostest\Documents

RFGEY

C:\Users\heliostest

SASHELP

( 'C:\Program Files\SASHome\SASFoundation\9.4\nls\en\SASCFG' 'C:\Program Files\SASHome\SASFoundation\9.4\core\sashelp' 'C:\Program Files\SASHome\SASFoundation\9.4\aacomp\sashelp' 'C:\Program Files\SASHome\SASFoundation\9.4\af\sashelp' 'C:\Program Files\SASHome\SASFoundation\9.4\assist\sashelp' 'C:\Program Files\SASHome\SASFoundation\9.4\cas\sashelp' 'C:\Program Files\SASHome\SASFoundation\9.4\cmp\sashelp' 'C:\Program Files\SASHome\SASFoundation\9.4\connect\sashelp' 'C:\Program Files\SASHome\SASFoundation\9.4\dmine\sashelp' 'C:\Program Files\SASHome\SASFoundation\9.4\eis\sashelp' 'C:\Program Files\SASHome\SASFoundation\9.4\ets\sashelp' 'C:\Program Files\SASHome\SASFoundation\9.4\genetics\sashelp' 'C:\Program Files\SASHome\SASFoundation\9.4\gis\sashelp' 'C:\Program Files\SASHome\SASFoundation\9.4\graph\sashelp' 'C:\Program Files\SASHome\SASFoundation\9.4\iml\sashelp' 'C:\Program Files\SASHome\SASFoundation\9.4\intrnet\sashelp' 'C:\Program Files\SASHome\SASFoundation\9.4\inttech\sashelp' 'C:\Program Files\SASHom

SASUSER

C:\Users\heliostest\Documents\My SAS Files\9.4

TMP1

C:\Program Files\SASHome\SASFoundation\9.4\core\sashelp

TMP2

C:\Users\heliostest\Documents\help

TMP3

C:\Program Files\SASHome\SASFoundation\9.4\intrnet\sashelp

WORK

C:\Users\HELIOS~1\AppData\Local\Temp\SAS Temporary Files\_TD10176_DESKTOP-CU59CJJ_

 

Does anyone know how I can get the full list of libraries through jdbc query?

3 REPLIES 3
SASKiwi
PROC Star

I suspect any metadata-defined libraries will need to be pre-assigned by ticking the box in the Advanced Options of the library's properties, for them to show in the VSLIB view.

jjyy123
Calcite | Level 5

I followed your suggestion by selecting pre-assigned in the Advanced Options, then I did see the self-created libraries in the Data Library Manager -> Libraries. However, if I created a library in base SAS:
Screen Shot 2020-01-06 at 10.55.32.png
Screen Shot 2020-01-06 at 11.00.45.png

Just as shown in the snapshot above, the `Mylib`, `Rfgey` library is self-created, how I could get the library path from querying sashelp.vslib through JDBC? I'm assuming it is because these self-created libraries are not registered in SAS workspace server, so I can not get the library paths from query results by JDBC querying SAS workspace server VSLIB table. If that's the reason, do you have any clue how I can get those library paths by remote querying?

jjyy123
Calcite | Level 5

And another question, if the library in workspace is not pre-assigned, is that possible I can submit SAS code via Java Connection Factory to change it to pre-assigned? And what would the code looks like? Any idea would be highly appreciated!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 803 views
  • 0 likes
  • 2 in conversation