sassoftware / saspy

A Python interface module to the SAS System. It works with Linux, Windows, and Mainframe SAS as well as with SAS in Viya.
https://sassoftware.github.io/saspy
Other
367 stars 149 forks source link

Updates to %%SAS magic. Created %%SASPROC and %%SASLOG magics. #6

Closed statmike closed 7 years ago

statmike commented 8 years ago

Created a generic %%PROC magic that can be used with any SAS proc and allows for proc statement options on the magic line. This magic will create the proc call specified and complete the call with a "run; quit;" line. Included 4 examples of the usage: PRINT, IML, OPTMODEL, SQL.

statmike commented 8 years ago

I update the cell magic %%PROC to make the log easier to read by include \n line returns.

This now includes two line magics for reviewing the SAS Log also: %LOG for retrieving the log of the last SAS submission %FULLLOG for retrieving the full log of the current SAS session

jld23 commented 8 years ago

@statmike I'm talking a look at these changes. One initial question is the magic names. Are PROC, LOG, and FULLLOG sufficiently specific to SAS that users will know it is for them? These magics will be available to users who have loaded the saspy.sas_magics. They won't be available to users of the sas_kernel. Thanks for contributing to the project and helping it grow!

Jared

statmike commented 8 years ago

@jld23 I agree with making the naming more specific to SAS. The goal is to make SAS as seamless to use as possible within a Python notebook. How about SASPROC to replace PROC? I could collapse LOG and FULLLOG into one line magic called SASLOG and use a line option to direct the Full log part. This would displace the need for the NBextensions while using a Python kernel. Thoughts?

jld23 commented 8 years ago

@statmike I think one log magic with an option for full log is great and I like the names. Can you make those change and then let me know when you've pushed the changes? Also can you outline any tests you ran?

Jared

statmike commented 8 years ago

@jld23 Thank you for asking me to outline tests. By doing that I was able to think through this and make it more concise.

I changed the %%SAS cell magic into a line_cell_magic. The cell magic version, %%SAS, performs as it did previously. The line magic version, %SAS, lets a user submit SAS code as a line magic. This can be handy for a quick libname statement or %LET statement for instance.

The %SASLOG line magic allows the user to recall the log for the most recent submission. With a "-FULL" option the user can request the full SAS log for the current session.

The %%SASPROC cell magic was added and also works as a %SASPROC line magic. This simplifies the submission of any SAS proc including interactive and non-interactive procs.

I tested the functionality and attempted to document the use of these magics in a Jupyter notebook named: Test Magics SAS SASPROC adn SASLOG.ipynb

tomweber-sas commented 7 years ago

Statmike, not sure if you've been in communication with Jared since the last update here, but we just got approval to push out the real saspy; python interface to SAS. Now that this is available, it makes the magics unnecessary, You can do anything and and more with saspy than with a (or some) magics(s). I'm going to close this request as it's kind of moot now, and you can start using saspy to do all kinds of work in SAS from your python code. Seeing the log for what you ran, and/or the entire log for the whole session, is an integral part of the interface, so there are no need for magics. You can run all of this in a python notebook or from a python command line, or from a python batch script; it's not part of jupyter like the sas_kernel is. You can get all the results like in the SAS_kernel notebook, but from the python kernel now (ODS tables and graphs ...).

Let me know if you have any questions, and feel free to enhance saspy now! It really is something that others can contribute to; there's lots to be able to contribute.

Thanks, Tom

statmike commented 7 years ago

This is really cool! I look forward to digging in and playing with it next week. Thank you

tomweber-sas commented 7 years ago

Well, I hate to write this, but you need to know. This project has been canceled and we had to remove it from GitHub/Pypi. The sas_kernel is still available, but not the fully python interface. If anything changes, I will let you know.

Thanks, Tom

From: Mike Henderson [mailto:notifications@github.com] Sent: Friday, July 22, 2016 5:48 PM To: sassoftware/saspy saspy@noreply.github.com Cc: Tom Weber Tom.Weber@sas.com; State change state_change@noreply.github.com Subject: Re: [sassoftware/saspy] Updates to %%SAS magic. Created %%SASPROC and %%SASLOG magics. (#6)

This is really cool! I look forward to digging in and playing with it next week. Thank you

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/sassoftware/saspy/pull/6#issuecomment-234665204, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQ48ZkxxmuSZHf4Z8fGA_b9AanHZJXNUks5qYTpzgaJpZM4ISa7b.