
SASPy¶
Date: May 02, 2023 Version: 5.1.2
Source Repository: http://github.com/sassoftware/saspy
Issues and Ideas: https://github.com/sassoftware/saspy/issues
Example Repo: https://github.com/sassoftware/saspy-examples
What is this?¶
This module provides Python APIs to the SAS system. You can start a SAS session and run analytics from Python through a combination of object-oriented methods or explicit SAS code submission. You can move data between SAS data sets and Pandas dataframes and exchange values between python variables and SAS macro variables.
The APIs provide interfaces for the following:
Start a SAS session on the same host as Python or a remote host.
Exchange data between SAS data sets and Pandas data frames.
Use familiar methods such as
describe()
andhead()
to work with data.
Additional functionality such as machine learning, econometrics, and quality control are organized in Python classes.
See Getting started for programming examples.
Dependencies¶
Python3.4 or higher.
SAS 9.4 or higher. SAS Viya 3.1 or higher is also supported.
To use the integrated object method (IOM) access method (one of four connection methods) requires Java 7 or higher on the client.
You can connect to SAS on any platform that is supported for the specified SAS releases.
- Installation
- Configuration
- Getting started
- API Reference
- SAS Session Object
SASsession
SASsession.SYSERR()
SASsession.SYSERRORTEXT()
SASsession.SYSFILRC()
SASsession.SYSINFO()
SASsession.SYSLIBRC()
SASsession.SYSWARNINGTEXT()
SASsession.assigned_librefs()
SASsession.cat()
SASsession.dataframe2sasdata()
SASsession.datasets()
SASsession.df2sd()
SASsession.df_char_lengths()
SASsession.dirlist()
SASsession.disconnect()
SASsession.download()
SASsession.endsas()
SASsession.exist()
SASsession.file_copy()
SASsession.file_delete()
SASsession.file_info()
SASsession.lastlog()
SASsession.lib_path()
SASsession.list_tables()
SASsession.read_csv()
SASsession.sasdata()
SASsession.sasdata2dataframe()
SASsession.sasets()
SASsession.saslib()
SASsession.saslog()
SASsession.sasml()
SASsession.sasqc()
SASsession.sasstat()
SASsession.sasutil()
SASsession.sasviyaml()
SASsession.sd2df()
SASsession.sd2df_CSV()
SASsession.sd2df_DISK()
SASsession.set_batch()
SASsession.set_results()
SASsession.sil()
SASsession.simple_interest_loan()
SASsession.submit()
SASsession.submitLOG()
SASsession.submitLST()
SASsession.symexist()
SASsession.symget()
SASsession.symput()
SASsession.teach_me_SAS()
SASsession.upload()
SASsession.validvarname()
SASsession.write_csv()
- SAS Data Object
SASdata
SASdata.add_vars()
SASdata.append()
SASdata.assessModel()
SASdata.bar()
SASdata.columnInfo()
SASdata.contents()
SASdata.delete()
SASdata.describe()
SASdata.head()
SASdata.heatmap()
SASdata.hist()
SASdata.impute()
SASdata.info()
SASdata.means()
SASdata.modify()
SASdata.obs()
SASdata.partition()
SASdata.rename()
SASdata.scatter()
SASdata.score()
SASdata.series()
SASdata.set_results()
SASdata.sort()
SASdata.tail()
SASdata.to_csv()
SASdata.to_df()
SASdata.to_df_CSV()
SASdata.to_df_DISK()
SASdata.to_frame()
SASdata.to_json()
SASdata.top()
SASdata.where()
- Procedure Syntax Statements
- SAS Results
- SAS Procedures
- SASPy Scripts
- SAS Session Object
- Advanced topics
- Using Batch mode
- Prompting
- Moving values between Python Variables and SAS Macro Variables
- Moving data between Python and SAS - datatype conversion
- Dates, Times and Datetimes, Oh my!
- Advanced sd2df and df2sd techniques
- Slow performance loading SAS data into a Pandas DataFrame ( to_df(), sd2df() )
- Slow performance loading a DataFrame into a SAS data set; df2sd()
- Using Proc iomoperate to find Object Spawner hosts and Workspace Server ports
- Disconnecting from an IOM session and reconnecting back to it.
- Configuring Grid Option Sets to have saspy run on a specific Queue.
- Automatic checking for ERROR: in the LOG and the warnings module
- saspy.logger from logging.logger as of V3.7.5
- SASsession object as a context manager as of V3.7.5
- Jupyter magics
- Contributing new methods
- Limitations, restrictions and work arounds
- Troubleshooting
- License