Good morning everyone,
I'm trying to write a python code for adding a correlation matrix in my SAS analysis.
I wrote it in Jupyter notebook but I'm having issues in connecting it to my SAS.
The code I tried is:
import sys
import os
import swat
#Connect to CAS
s = swat.CAS(os.environ['CASUSER'], os.environ['CASPORT'], None, os.environ.get("SAS_VIYA_TOKEN"))
s
The error I get is:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-23-06a09f769b64> in <module>
1 #Connect to CAS
----> 2 s = swat.CAS(os.environ['CASUSER'], os.environ['CASPORT'], None, os.environ.get("SAS_VIYA_TOKEN"))
3 s
~/opt/anaconda3/lib/python3.8/os.py in __getitem__(self, key)
673 except KeyError:
674 # raise KeyError with the original key value
--> 675 raise KeyError(key) from None
676 return self.decodevalue(value)
677
KeyError: 'CASUSER'
Thank you so much!