Sas single layer

Is there a way to run single line in sas, or do I need to create a file? I am looking for something like the -e flag in perl.

+5
source share
5 answers

My favorite option is -stdio

Or:

sas -stdio

Then start typing. Or...

echo "proc options; run;" | sas -stdio
+7
source

The Unix version of SAS was ported from MVS several years ago, and to make the long history short, the SAS executable does not import from STDIN. To make this work on Unix, slightly change the previous sentence to something like:

echo "your SAS code" > temp;sas -sysin temp

Hope this will be helpful.

+5
source
sas -initstmt '%put hello world ; endsas ;' 

sas -initstmt 'proc print data=sashelp.class; run ;' 

, :

sas -initstmt '%inc large_program.sas; endsas;'
+3

sas, - :

echo <insert sas code here> | sas --execute-file -

Often applications will let you specify a “-” as a file so that it reads STDIN. And the "echo" just displays its arguments, and | connects them together.

0
source

You can also use the option -nodms. This will give you the Base command line version.

0
source

All Articles