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

run_sas: to accept more than one SAS file #512

Closed ShuguangSun closed 1 year ago

ShuguangSun commented 1 year ago

This PR makes run_sas.py accpect more than one SAS file, e.g.,

saspy or run_sas doesn't honor autoexec.sas automatically which is different with SAS V9 in batch mode. Our projects use autoexec.sas and a project level setting SAS file to manange project settings. We have to using %include in each file if we call run_sas. It makes the code complicated and %include can't includes the remote file which might not be the updated one.

In case we are using IOM with Workspace server (for example, SAS EG), after the PR, run_sas can source local copy files which is different to %inclue which source the one the server.

It makes the run_sas a kind workable solution using in the task in vscode.

tomweber-sas commented 1 year ago

Hey, thanks for enhancing this! Appreciate the contribution. This seems like a good addition and I've been trying it out and it works well. Do you mind adding a comment/signature based upon the CONTRIBUTING.md in the root of the repo. I'll be happy to merge this in then.

Also, just another way you have to implement autoexec functionality from the client side is to use that keyword in your config. That works for both saspy in any python as well as for this script. In the simplest way you could do this (course you could write a few lines of code and open, read into a variable, close then pass in the variable). Just FYI:

auto     = {'java'      : '/usr/bin/java',
            'authkey'   : 'saspy1',
            'iomhost'   : 'tom64-7',
            'iomport'   : 8591,
            'autoexec'  : open('autoexec.sas').read()
           }
ShuguangSun commented 1 year ago

Now add the signed-off.

Thanks for the tips.

tomweber-sas commented 1 year ago

Awesome, thanks again!