<?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 SASPy: Cannot Access SAS Libraries That Are Available in DI Studio in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SASPy-Cannot-Access-SAS-Libraries-That-Are-Available-in-DI/m-p/373895#M11555</link>
    <description>&lt;P&gt;My question relates to the SASPy module for Python and specifically how to connect to all libraries that are available in SAS DI Studio. I have setup a winiomwin connection using the package configuration file. I have the following lines in sascfg.py :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SAS_config_names = ['winiomwin']&lt;BR /&gt;SAS_config_options = {'lock_down': True}&lt;BR /&gt;&lt;BR /&gt;# build out a local classpath variable to use below for Windows clients&lt;BR /&gt;cpW = "C:\\Program Files\\SASHome94\\SASDeploymentManager\\9.4\\products\\deploywiz__94390__prt__xx__sp0__1\\deploywiz\\sas.svc.connection.jar"&lt;BR /&gt;cpW += ";C:\\Program Files\\SASHome94\\SASDeploymentManager\\9.4\\products\\deploywiz__94390__prt__xx__sp0__1\\deploywiz\\log4j.jar"&lt;BR /&gt;cpW += ";C:\\Program Files\\SASHome94\\SASDeploymentManager\\9.4\\products\\deploywiz__94390__prt__xx__sp0__1\\deploywiz\\sas.security.sspi.jar"&lt;BR /&gt;cpW += ";C:\\Program Files\\SASHome94\\SASDeploymentManager\\9.4\\products\\deploywiz__94390__prt__xx__sp0__1\\deploywiz\\sas.core.jar"&lt;BR /&gt;cpW += ";C:\\Users\\hsej\\AppData\\Local\\Programs\\Python\\Python36-32\\Lib\\site-packages\\saspy\\java\\saspyiom.jar"&lt;BR /&gt;&lt;BR /&gt;# and, if you've configured iom to use encryption, you need these client side jars&lt;BR /&gt;cpW += ";C:\\Program Files\\SASHome94\\SASVersionedJarRepository\\eclipse\\plugins\\sas.rutil_904300.0.0.20150204190000_v940m3\\sas.rutil.jar"&lt;BR /&gt;cpW += ";C:\\Program Files\\SASHome94\\SASVersionedJarRepository\\eclipse\\plugins\\sas.rutil.nls_904300.0.0.20150204190000_v940m3\\sas.rutil.nls.jar"&lt;BR /&gt;cpW += ";C:\\Program Files\\SASHome94\\SASVersionedJarRepository\\eclipse\\plugins\\sastpj.rutil_6.1.0.0_SAS_20121211183517\\sastpj.rutil.jar"&lt;BR /&gt;&lt;BR /&gt;# Windows client and Windows IOM server&lt;BR /&gt;winiomwin = {'java': 'C:\\ProgramData\\Oracle\\java\\javapath\\java.exe',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'iomhost': 'xx.xxx.xx.xx',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'iomport': 8591,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'authkey': 'xxx',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'encoding': 'windows-1252',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'classpath': cpW,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'appserver' : 'xxx'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition, I have placed the _authinfo file in my home folder and have updated all classpath variables. This connection works technically and I can start my session.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I start a SAS session like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import odksas&lt;BR /&gt;from odksas import output&lt;BR /&gt;from odksas.constants import CONSTANTS, SYNTAX&lt;BR /&gt;&lt;BR /&gt;# Start session&lt;BR /&gt;sas = odksas.create_sas_session_object()&lt;BR /&gt;&lt;BR /&gt;# Execute code&lt;BR /&gt;code = sas.submit(SYNTAX.get('test_1'))&lt;BR /&gt;output.get_sas_output(code)&lt;BR /&gt;output.get_sas_output(sas.datasets('yyy'))&lt;BR /&gt;&lt;BR /&gt;test = sas.sasdata('data_file_name', 'yyy')&lt;BR /&gt;output.get_sas_output(test.describe())&lt;BR /&gt;output.get_sas_output(test.head(100))&lt;BR /&gt;&lt;BR /&gt;# SAS model object&lt;BR /&gt;cars = sas.sasdata('cars', 'sashelp')&lt;BR /&gt;output.get_sas_output(cars.bar('EngineSize'))&lt;BR /&gt;&lt;BR /&gt;stat = sas.sasstat()&lt;BR /&gt;my_dict = {'model': 'horsepower = cylinders enginesize', 'by': 'type', 'data': cars.sort('type')}&lt;BR /&gt;model = stat.reg(**my_dict)&lt;BR /&gt;output.get_sas_output(model)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code executes without error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now here is my question:&lt;/P&gt;&lt;P&gt;In DI Studio I can access data that I am not able to access through the SASPy session. How is this possible? I would like to access the same data via the SASPy session.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, when I "check out" a job with at least one source table and run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname _ALL_ list;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can access the following libref (log):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;NOTE: Libref=   xxx
      Scope=    IOM ROOT COMP ENV
      Engine=   BASE
      Physical Name= x:\xxxx\xxxx\xxx\xxx\Data
      Filename= x:\xxxx\xxxx\xxx\xxx\Data&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I cannot access the same libref when I run the same statement (libname _ALL_ list) from the SASPy session. Also when I try to run the libname assignment that works in DI Studio, I get this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/* Access the data for xxx  */
LIBNAME xxx BASE "x:\xxxx\xxxx\xxx\xxx\Data";
NOTE: Library xxx does not exist.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think there is something wrong with my connection, can someone figure it out? I have read the guides and troubleshooting section on the package webpage without finding answers.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Oct 2017 15:32:46 GMT</pubDate>
    <dc:creator>Hsej</dc:creator>
    <dc:date>2017-10-27T15:32:46Z</dc:date>
    <item>
      <title>SASPy: Cannot Access SAS Libraries That Are Available in DI Studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SASPy-Cannot-Access-SAS-Libraries-That-Are-Available-in-DI/m-p/373895#M11555</link>
      <description>&lt;P&gt;My question relates to the SASPy module for Python and specifically how to connect to all libraries that are available in SAS DI Studio. I have setup a winiomwin connection using the package configuration file. I have the following lines in sascfg.py :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SAS_config_names = ['winiomwin']&lt;BR /&gt;SAS_config_options = {'lock_down': True}&lt;BR /&gt;&lt;BR /&gt;# build out a local classpath variable to use below for Windows clients&lt;BR /&gt;cpW = "C:\\Program Files\\SASHome94\\SASDeploymentManager\\9.4\\products\\deploywiz__94390__prt__xx__sp0__1\\deploywiz\\sas.svc.connection.jar"&lt;BR /&gt;cpW += ";C:\\Program Files\\SASHome94\\SASDeploymentManager\\9.4\\products\\deploywiz__94390__prt__xx__sp0__1\\deploywiz\\log4j.jar"&lt;BR /&gt;cpW += ";C:\\Program Files\\SASHome94\\SASDeploymentManager\\9.4\\products\\deploywiz__94390__prt__xx__sp0__1\\deploywiz\\sas.security.sspi.jar"&lt;BR /&gt;cpW += ";C:\\Program Files\\SASHome94\\SASDeploymentManager\\9.4\\products\\deploywiz__94390__prt__xx__sp0__1\\deploywiz\\sas.core.jar"&lt;BR /&gt;cpW += ";C:\\Users\\hsej\\AppData\\Local\\Programs\\Python\\Python36-32\\Lib\\site-packages\\saspy\\java\\saspyiom.jar"&lt;BR /&gt;&lt;BR /&gt;# and, if you've configured iom to use encryption, you need these client side jars&lt;BR /&gt;cpW += ";C:\\Program Files\\SASHome94\\SASVersionedJarRepository\\eclipse\\plugins\\sas.rutil_904300.0.0.20150204190000_v940m3\\sas.rutil.jar"&lt;BR /&gt;cpW += ";C:\\Program Files\\SASHome94\\SASVersionedJarRepository\\eclipse\\plugins\\sas.rutil.nls_904300.0.0.20150204190000_v940m3\\sas.rutil.nls.jar"&lt;BR /&gt;cpW += ";C:\\Program Files\\SASHome94\\SASVersionedJarRepository\\eclipse\\plugins\\sastpj.rutil_6.1.0.0_SAS_20121211183517\\sastpj.rutil.jar"&lt;BR /&gt;&lt;BR /&gt;# Windows client and Windows IOM server&lt;BR /&gt;winiomwin = {'java': 'C:\\ProgramData\\Oracle\\java\\javapath\\java.exe',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'iomhost': 'xx.xxx.xx.xx',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'iomport': 8591,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'authkey': 'xxx',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'encoding': 'windows-1252',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'classpath': cpW,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'appserver' : 'xxx'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition, I have placed the _authinfo file in my home folder and have updated all classpath variables. This connection works technically and I can start my session.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I start a SAS session like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import odksas&lt;BR /&gt;from odksas import output&lt;BR /&gt;from odksas.constants import CONSTANTS, SYNTAX&lt;BR /&gt;&lt;BR /&gt;# Start session&lt;BR /&gt;sas = odksas.create_sas_session_object()&lt;BR /&gt;&lt;BR /&gt;# Execute code&lt;BR /&gt;code = sas.submit(SYNTAX.get('test_1'))&lt;BR /&gt;output.get_sas_output(code)&lt;BR /&gt;output.get_sas_output(sas.datasets('yyy'))&lt;BR /&gt;&lt;BR /&gt;test = sas.sasdata('data_file_name', 'yyy')&lt;BR /&gt;output.get_sas_output(test.describe())&lt;BR /&gt;output.get_sas_output(test.head(100))&lt;BR /&gt;&lt;BR /&gt;# SAS model object&lt;BR /&gt;cars = sas.sasdata('cars', 'sashelp')&lt;BR /&gt;output.get_sas_output(cars.bar('EngineSize'))&lt;BR /&gt;&lt;BR /&gt;stat = sas.sasstat()&lt;BR /&gt;my_dict = {'model': 'horsepower = cylinders enginesize', 'by': 'type', 'data': cars.sort('type')}&lt;BR /&gt;model = stat.reg(**my_dict)&lt;BR /&gt;output.get_sas_output(model)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code executes without error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now here is my question:&lt;/P&gt;&lt;P&gt;In DI Studio I can access data that I am not able to access through the SASPy session. How is this possible? I would like to access the same data via the SASPy session.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, when I "check out" a job with at least one source table and run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname _ALL_ list;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can access the following libref (log):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;NOTE: Libref=   xxx
      Scope=    IOM ROOT COMP ENV
      Engine=   BASE
      Physical Name= x:\xxxx\xxxx\xxx\xxx\Data
      Filename= x:\xxxx\xxxx\xxx\xxx\Data&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I cannot access the same libref when I run the same statement (libname _ALL_ list) from the SASPy session. Also when I try to run the libname assignment that works in DI Studio, I get this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/* Access the data for xxx  */
LIBNAME xxx BASE "x:\xxxx\xxxx\xxx\xxx\Data";
NOTE: Library xxx does not exist.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think there is something wrong with my connection, can someone figure it out? I have read the guides and troubleshooting section on the package webpage without finding answers.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 15:32:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SASPy-Cannot-Access-SAS-Libraries-That-Are-Available-in-DI/m-p/373895#M11555</guid>
      <dc:creator>Hsej</dc:creator>
      <dc:date>2017-10-27T15:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: SASPy: Cannot Access SAS Libraries That Are Available in DI Studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SASPy-Cannot-Access-SAS-Libraries-That-Are-Available-in-DI/m-p/379455#M11556</link>
      <description>&lt;P&gt;I had to add the full path to the data file directory in the libref assignment, including iomserver and parent directories. Here is an example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/* Assign libref from SASPy session */
LIBNAME mylib BASE "!SAS_REP\xxxx\xxxx\xxx\xxx\Data";&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;!SAS_REP is a user-defined environment variable on the Windows client machine, for example: "\\sas-app-x-xx\Data". Remember to add the environment variable to the client machine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it is not necessary to use the environment variable. This works as well:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/* Assign libref from SASPy session */
LIBNAME mylib BASE "\\sas-app-x-xx\Data\xxxx\xxxx\xxx\xxx\Data"; &lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Oct 2017 16:12:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SASPy-Cannot-Access-SAS-Libraries-That-Are-Available-in-DI/m-p/379455#M11556</guid>
      <dc:creator>Hsej</dc:creator>
      <dc:date>2017-10-27T16:12:49Z</dc:date>
    </item>
  </channel>
</rss>

