Shuguang
Shuguang

Reputation: 2071

In org babel, how to get results from an output file?

I'm trying write a org babel for SAS. And it is known that SAS can only generate a 'XXX.lst' from source 'XXX.sas' if the output lst file is not specified. Now I meet the problem to get the file content of 'XXX.lst' to the corresponding results '#+RESULTS:'. How to do it?

Upvotes: 1

Views: 764

Answers (1)

Alex Vorobiev
Alex Vorobiev

Reputation: 4359

Org mode will try to call your org-babel-execute:sas function. If you are working with SAS via ESS, the best way to implement execution of SAS source code blocks in Org model is to mimic the integration with R (in ob-R.el) and connect Org to the ESS SAS session. The user's documentation is here.

Or you can just call SAS in your org-babel-execute:sas and substitute the output file like this:

(with-temp-buffer (insert-file-contents your-sas-output-file) (buffer-string))

Upvotes: 1

Related Questions