Code Monkey home page Code Monkey logo

Comments (15)

edwinhu avatar edwinhu commented on September 17, 2024 1

Sure, I just sent a message to the e-mail you have listed on your github profile.

from sas_kernel.

tomweber-sas avatar tomweber-sas commented on September 17, 2024 1

That sounds just as strange as half of the things we were seeing. I can't account for how that would affect ODS. If it's really the case, you can add your USER libname statement to your 'autoexec' key in your saspy configuration; it's just a string of SAS code that I'll submit for you once I establish the connection (after the ods stmt), before returning from the SASsession call. That way, you can still have user assigned automatically, but after the ods stmt.

Also, I just went through my code and found a couple places where a table was supposed to explicitly go to work, but was going to user, when user is assigned. I've fixed those (SASdata object's head() and tail()). I've pushed that out too and that will be in 4.3.2 when I build that. I don't think that's an issue you were seeing yet though.

Tom

from sas_kernel.

jld23 avatar jld23 commented on September 17, 2024

from sas_kernel.

tomweber-sas avatar tomweber-sas commented on September 17, 2024

I'm not sure that will really work. And since you can't set the SASsession attribute sas.HTML_Style = 'Raven' like you can in a Python notebook, I've added an option in the config so you can change the default so that you're SAS notebook will use that style:

SAS_output_options = {'output' : 'html5',       # not required unless changing any of the default
                      'style'  : 'Raven'}

Just add the 'style' key to your SAS_output_options dict and specify the style to use. I've pushed this change to main, can you pull from there and test it out?

Thanks,
Tom

from sas_kernel.

edwinhu avatar edwinhu commented on September 17, 2024

Tom,

I now have the latest version of saspy (4.3.1) and made the change to the SAS_output_options dict as provided above.

For sas_kernel I am now getting an "ERROR: Unable to establish ODS Graphics context."

A basic command like the following just hangs:

proc print data=sashelp.cars(obs=25);run;

Using saspy directly in a Python notebook I don't see any error message, but the sas.HTML_Style attribute is still 'HTMLBlue' and the output that I get still looks like HTMLBlue:

c = sas.submit("""proc print data=sashelp.cars(obs=10);run;""")
HTML(c['LST'])

Happy to provide more info. Thanks for your help.

Edwin

from sas_kernel.

tomweber-sas avatar tomweber-sas commented on September 17, 2024

Hey, did you pull the code from main or just do a pip install? I only pushed this change to my saspy repo, I haven't built it into a new release (I just built 4.3.1 yesterday).

I don't know why you would be getting an error in the SAS notebook. Can't imagine what could be causing that. Did something else change? Did you restart the notebook after installing saspy?

You can install from main like this (do an uninstall first):
pip uninstall -y saspy
pip install git+https://[email protected]/sassoftware/saspy.git

from sas_kernel.

tomweber-sas avatar tomweber-sas commented on September 17, 2024

Or, did you get main, and whatever you specified wasn't found or something? Can you show your config and the log after running each of those in their notebooks? BTW, in saspy you can simple run
sas.submitLST("proc print data=sashelp.cars(obs=10);run;")
which will render the output for you, if there is any, else render the log. Easier than the 2 steps with just submit().

from sas_kernel.

edwinhu avatar edwinhu commented on September 17, 2024

Did a fresh install (new conda environment) and saspy is working (at least the SASsession approach).

Screen Shot 2022-07-07 at 5 11 37 PM

The error message also shows up when I try to use the %%SAS magic.

Screen Shot 2022-07-07 at 5 14 38 PM

from sas_kernel.

tomweber-sas avatar tomweber-sas commented on September 17, 2024

Ok, it seems you have the code. That magic isn't very useful in that it starts it's own session and you can't really make it show the SAS LOG so you can see what was really there. Can you try that in a SAS notebook and it ought to show the log from submitting the proc, so we can see the log for that instead of only one line.

from sas_kernel.

edwinhu avatar edwinhu commented on September 17, 2024

This appears to be the relevant portion of the %showFullLog. I'm not sure what is going on because the SAS notebook was working fine (same server) earlier. I'm running sas_kernel 2.4.12 (also fresh install, via pip+git).

2     options svgtitle='svgtitle'; options validvarname=any validmemname=extend;
                                           ------------
                                           36
WARNING 36-12: SAS option VALIDVARNAME is restricted by your Site Administrator 
               and cannot be updated.

2   ! options svgtitle='svgtitle'; options validvarname=any validmemname=extend;
                                                            ------------
                                                            36
2   !  ods graphics on;
WARNING 36-12: SAS option VALIDMEMNAME is restricted by your Site Administrator 
               and cannot be updated.

ERROR: Unable to establish ODS Graphics context.

from sas_kernel.

tomweber-sas avatar tomweber-sas commented on September 17, 2024

Ohhhh, well that's new. So, then, what happens when you submit other code after that initial error? Those statements are a one time thing when I first establish a connection. In the SAS notebook, what happens if you try another line of code after?

from sas_kernel.

tomweber-sas avatar tomweber-sas commented on September 17, 2024

Since it worked in saspy, and the SAS kernel just calls sas.submit(), I expect the next thing you submit will work since it worked in saspy. If you look at the log in saspy you ought to see the same error in the log; it just didn't keep the next thing from running.
print(sas.saslog())

from sas_kernel.

edwinhu avatar edwinhu commented on September 17, 2024

From the SAS notebook I can't run any other code (just hangs). Interestingly, I get the warnings from saspy, but no ODS Graphics Error. From print(sas.saslog()):

2     options svgtitle='svgtitle'; options validvarname=any validmemname=extend;
                                           ------------
                                           36
WARNING 36-12: SAS option VALIDVARNAME is restricted by your Site Administrator 
               and cannot be updated.

2   ! options svgtitle='svgtitle'; options validvarname=any validmemname=extend;
                                                            ------------
                                                            36
2   !  ods graphics on;
WARNING 36-12: SAS option VALIDMEMNAME is restricted by your Site Administrator 
               and cannot be updated.

from sas_kernel.

tomweber-sas avatar tomweber-sas commented on September 17, 2024

have you go time for a teams call so I can actually see what you're seeing? This is really odd.

from sas_kernel.

edwinhu avatar edwinhu commented on September 17, 2024

Ok so it appears the cause of the error is a bug in SAS 9.4 itself:

Removing the USER library definition in my autoexec.sas solves the problem (works both with saspy and sas_kernel).

Setting the USER library after turning on ODS Graphics does not "break" ODS Graphics either. So I think the latest saspy (4.3.1) solves my issue without creating any new errors.

from sas_kernel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.