BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
AnushaShreyas
Calcite | Level 5

I have imported .csv file from local pc and converted it into .sas7bdat file using saspy, the result is currently saving on sas server (cloud) , I need the file to be stored in my local system, As I am a new user I dont know much about using saspy please help me with this issue.

1 ACCEPTED SOLUTION

Accepted Solutions
sastpw
SAS Employee

Sure, just use SASPy's download method of your SASsession object (look for download in the API doc: https://sassoftware.github.io/saspy/api.html#

 

you would do something like the following:

 

resutls = sas.download(r'D:/sas_test_data', sas.workpath+'sas.sas7bdat)

 

give it a try!

Tom

 

Tried to copy it here:

 

download(localfile: str, remotefile: str, overwrite: bool = True, **kwargs)

This method downloads a remote file from the SAS servers file system.

Parameters:
  • localfile – path to the local file to create or overwrite
  • remotefile – path to remote file
  • overwrite – overwrite the output file if it exists?
Returns:

dict with 2 keys {‘Success’ : bool, ‘LOG’ : str}

 

View solution in original post

4 REPLIES 4
AnushaShreyas
Calcite | Level 5
Thanks for the reply, I am using local path to fetch the dataset (i.e D:/sas_test_data/sas.csv). And I am using python jupyter notebook to get this data and convert it into sas.sas7bdat and its saved in sas server.
But I want it to save in same location (i.e D:/sas_test_data/sas.sas7bdat) using saspy and python only, bec i am using it for automation, I cant always go to sas studio and get it downloaded, if you have any solutions for this please let me know, Thanks.
sastpw
SAS Employee

Sure, just use SASPy's download method of your SASsession object (look for download in the API doc: https://sassoftware.github.io/saspy/api.html#

 

you would do something like the following:

 

resutls = sas.download(r'D:/sas_test_data', sas.workpath+'sas.sas7bdat)

 

give it a try!

Tom

 

Tried to copy it here:

 

download(localfile: str, remotefile: str, overwrite: bool = True, **kwargs)

This method downloads a remote file from the SAS servers file system.

Parameters:
  • localfile – path to the local file to create or overwrite
  • remotefile – path to remote file
  • overwrite – overwrite the output file if it exists?
Returns:

dict with 2 keys {‘Success’ : bool, ‘LOG’ : str}

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 2000 views
  • 0 likes
  • 3 in conversation