Hey, I'm a little confused. saspy has a way for you to store credentials in a secure file so that you don't need to do any of the things you're trying to do, based upon the other users suggestion, which was basically, try to implement that yourself. That was a fine idea, except there's no need, and trying to implement it yourself doesn't get you working when trying to use the magic.
Did you see my post about the authinfo file, with the instructions and the link to the documentation? If you put your credentials in the authinfo file, then saspy will just work without prompting you for all cases. And you don't need to write special code to try to implement it yourself.
Two other things worth noting. the magic creates its own SASsession to use. That was the default behavior when it was originally implemented. Since then it was enhanced to take a SASsession object and use that session to submit the code.The magic just calls the submit() method and displays the LST, if there is one, else the LOG.
In the current release, V3.1.8, there are two new variants of the submit method; submitLOG() and submitLST() (these are in the API doc), They are like the magic in that instead of returning the LOG and LST to you in a dictionary (as submit does), instead the submitLOG just displays the LOG and the submitLST displays the LST (results). submitLST also has a method= paramter to allow you to have it display the log if there is no LST, or to display both in either order you like. The default is the LST whether there is any or not.
So, sas.submitLST("sas code", method='listorlog') is basically the same as the magic. If there output it's display that directly. If there's no output, the LOG is displayed instead.
Either of these last two things will get you a work around the issue with not being able use the magic with your self implemented credentials, but I would suggest using the supported method instead, and not having any of these issues to begin with.
Tom
... View more