Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Unable to run SAS code in Docker container-no permission for library SASHELP #34

Open
alanzablocki opened this issue Jul 9, 2019 · 0 comments

Comments

@alanzablocki
Copy link

Describe the bug
Running sample code on iris dataset from lib sashelp fails. This was tested on a local and Azure hosted single programming-only container. This fails in SAS Studio, SAS kernel as well as in SASPy. The user is sasdemo from the auth-demo addon.

In SAS the error is
SAS Connection established. Subprocess id is 56916

No encoding value provided. Will try to determine the correct encoding.
Setting encoding to utf_8 based upon the SAS session encoding value of utf-8.

24 ods listing close;ods html5 (id=saspy_internal) file=stdout options(bitmap_mode='inline') device=svg style=HTMLBlue; ods graphics on / outputfmt=png;
NOTE: Writing HTML5(SASPY_INTERNAL) Body file: STDOUT
25
26 proc hpsample data=sashelp.iris out=sashelp.iris samppct=70.0 seed=9878 Partition;
ERROR: User does not have appropriate authorization level for library SASHELP.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE HPSAMPLE used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

27 class character;
28 target species;
29 var numeric;
30 run;
31
32
33
34
35
36 ods html5 (id=saspy_internal) close;ods listing;

37

In Python the full error is


RuntimeError Traceback (most recent call last)
in
----> 1 iris_part = iris.partition(fraction=.7, var='species')

/usr/local/lib/python3.6/site-packages/saspy/sasdata.py in partition(self, var, fraction, seed, kfold, out, singleOut)
431 elog.append(line)
432 if len(elog):
--> 433 raise RuntimeError("\n".join(elog))
434 if not singleOut:
435 outTableList = []

RuntimeError: ERROR: User does not have appropriate authorization level for library SASHELP.

To Reproduce
In a container with Python addon, open a notebook with SAS kernel and run
proc hpsample data=sashelp.iris out=sashelp.iris samppct=70.0 seed=9878 Partition;
class character;
target species;
var numeric;
run;

In a python kernel setup a SASpy session and run
import saspy
import pandas as pd
from IPython.display import HTML
sas = saspy.SASsession()
sas
iris = sas.sasdata('iris','sashelp')
iris_part = iris.partition(fraction=.7, var='species')

Expected behavior
Should be able to run basic code. If there is a SAS permission issue on this the danger is that many machine learning methods will fail, because they have built in sampling and partitioning methods.

Env

Client:
Version: 18.09.6
API version: 1.39
Go version: go1.10.8
Git commit: 481bc77156
Built: Sat May 4 02:34:58 2019
OS/Arch: linux/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 18.09.6
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: 481bc77
Built: Sat May 4 02:02:43 2019
OS/Arch: linux/amd64
Experimental: false

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant