Closed sourabh2404 closed 1 year ago
Without seeing what you are getting from that SAS7BDAT method (that's not a SAS provided package), I'm not sure what you're getting. But, with SASPy, and it seems you have a connection to your remote server with it, you could just do the following and have SAS access the file correctly for you (if I understand right):
sas = saspy.SASsession(**iomj)
sas.upload('abc.sas7bdat', sas.workpath)
sas_ds = sas.sasdata('abc', 'work') # now sas_ds is your SASData object and you can do whatever you want with it
sas_ds.head() # or whatever you want
df = sas_ds.to_df() # now it's a dataframe back in your python session
Is that what you're looking for?
Tom
This is great, I was looking for something like this. Thank you
Hi,
I have a sas7bdat file in my local system. I have tried the following code:-
with SAS7BDAT('abc.sas7bdat') as file:
sas = saspy.SASsession(**iomj)
sas_df = sas.df2sd(df, 'TEST_WRITE', 'MYLIB')
but using this the format of data changes when I check it in the TEST_WRITE table in the SAS server. Is there a way to load this local file (abc.sas7bdat) to a SAS instance on a different server?