Monday, 15 September 2014

How do I invoke a sas script in python? -



How do I invoke a sas script in python? -

i can open sas instance im not how run specific sas script.

im using next code start sas:

import subprocess subprocess.call(['c:\program files\sas\sasfoundation\9.2\sas.exe'])

you can pass additional parameters through sas via subprocess call, of import things need remember are:

you need tell sas find autoexec file

you need tell sas find config file

i have shell script utilize invoke sas scripts , phone call looks like:

sas -config $sas_config -autoexec $sas_autoexec $sas_code/$1

so phone call should like: subprocess.call(['c:\program files\sas\sasfoundation\9.2\sas.exe', '-config', config_path, '-autoexec', autoexec_path, '-sysin', sas_script_path])

you'll need set variables paths above.

good luck!

python sas

No comments:

Post a Comment