Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAS Connection established but ODS initialization failed(Can't find _tomods1) #623

Open
EnderW7 opened this issue Dec 3, 2024 · 4 comments

Comments

@EnderW7
Copy link

EnderW7 commented Dec 3, 2024

Describe the bug
SAS Connection established but ODS initialization failed, it can't find the file named "_tomods1".
1.Submit the following code:
`import saspy

sas = saspy.SASsession(cfgname='winiomwin')
sas.submit(
'''
%let Stu = Test;
''')
`
2.See error
'ERROR: Unable to load module 'html5' from template storage!
ERROR: There is no Body file, therefore no HTML5 (SASPY_INTERNAL) output will be created.'
instead of it working

Screenshots
企业微信截图1

Configuration information
sascfg_personal.txt

@tomweber-sas
Copy link
Contributor

Well, that's a new one. I've never seen that error before. Your config is fine, and clearly, you've connected. What version of SAS are you connecting to? HTML5 is the default for ODS output since the first version of 9.4. I don't know how it wouldn't be there. Is this an earlier version of SAS?
There are two things you can try, just to see what happens. You can try setting ODS to use HTML (no '5'), just to see what happens. That's in your config file:
SAS_output_options = {'output' : 'html',
This won't work correctly since you're connected remotely, so it isn't a workaround; just an experiment to see what we see. HTML doesn't have the images embedded in the html (like html5 does), but rather as separate files with links inside the html. So the links won't work since the image files aren't transferred over to your client machine. This is just to see if you get the same error for HTML or not, really.
The other thing is to set results='text' on your submit() and see that it works as expected; it should since it's not trying to use ODS then. Again, that doesn't solve this, just trying to get more information.
And to that regard, can you submit your SASsession object and show the output; that provides me with more info that I need.

For instance:

>>> sas = saspy.SASsession(cfgname='iomj')
SAS Connection established. Subprocess id is 624054

>>> sas
Access Method         = IOM
SAS Config name       = iomj
SAS Config file       = /opt/tom/github/saspy/saspy/sascfg_personal.py
WORK Path             = /sastmp/SAS_work1C06000985A4_tom64-7/SAS_workDC45000985A4_tom64-7/
SAS Version           = 9.04.01M8P01182023
SASPy Version         = 5.101.0
Teach me SAS          = False
Batch                 = False
Results               = Pandas
SAS Session Encoding  = utf-8
Python Encoding value = utf_8
SAS process Pid value = 624036
SASsession started    = Tue Dec  3 09:41:16 2024


>>>

@EnderW7
Copy link
Author

EnderW7 commented Dec 4, 2024

Thanks a lot for your help, Tom! And the following information is for your reference.

1.This is the log that I try to set ODS to use HTML (no '5'):
2
P.S. The Translation of Chinese part is still
'ERROR: Unable to load module 'html5' from template storage!
ERROR: There is no Body file, therefore no HTML5 (SASPY_INTERNAL) output will be created.'

2.This is the output when I submit my SASsession object:
3

@tomweber-sas
Copy link
Contributor

Oh, I'm so sorry, I never hit submit on this :( typed it in back when you posted.

So, changing to HTML didn't take effect; the log above still shows the same html5 code and error. So I don't see that or just using results='text' (which should just work as there's no ODS statements submitted).
You're running current SAS and saspy, so that's all good.
Do you have a SAS Admin to ask why HTML5 can't be loaded, since that's the default and I don't understand how you would be getting that error? That's kinda the real issue. These other things to try are just trying to gather more data since I have no idea how you would be getting that error from SAS.

@tomweber-sas
Copy link
Contributor

@EnderW7 any follow up on this? It's not something I've ever seen before. SAS should be using HTML5 by default. It's a SAS issue that needs either a SAS admin of SAS Tech Support to understand why it can't use the default ODS destination.

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

No branches or pull requests

2 participants