Initial Commit
[packages] / xemacs-packages / ess / etc / ess-sas-sh-command
1 #!/bin/sh
2
3 ### (C) 1997, Richard M. Heiberger.
4 ### This file is part of ESS.
5
6 ## This file is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation; either version 2, or (at your option)
9 ## any later version.
10
11 ## This file is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ## GNU General Public License for more details.
15
16 ## You should have received a copy of the GNU General Public License
17 ## along with GNU Emacs; see the file COPYING.  If not, write to
18 ## the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 # For executing SAS, and running it in the proper manner for ESS
21 # (feeding output back into appropriate ESS buffers).
22
23 #echo $0 $@
24 #sas </dev/tty 1>$1 2>$2 $3
25
26 set -x
27 stdout=$1
28 stderr=$2
29 shift 2
30 set +x
31 echo sas \</dev/tty 1\>$stdout 2\>$stderr $@
32 sas </dev/tty 1>$stdout 2>$stderr $@
33
34 ## From the SAS online tech support:
35 ##
36 ## Redirecting the SAS Log and Output under UNIX. 
37 ## 
38 ## There are several ways of redirecting the SAS Log and Output under
39 ## UNIX.  
40 ## 
41 ## To redirect the SAS Log, follow one of these steps: 
42 ## 
43 ##    1.
44 ##          In the source code, place the following line: 
45 ## 
46 ##          proc printto log=stdout;
47 ## 
48 ##          to make a duplicate copy of the log in a file in addition
49 ##          to redirecting it to stdout, use this command to invoke
50 ##          SAS:  
51 ## 
52 ##          sas -altlog doit.log doit.sas
53 ## 
54 ##    2.Execute SAS in the background and use the UNIX 'tail' command
55 ##      to copy lines to stdout as they are added to the log. Use the 
56 ##      command: 
57 ## 
58 ##      sas doit.sas &; tail -f doit.log
59 ## 
60 ## To redirect the SAS Log and Output under the Korn shell, use the
61 ## following command:  
62 ## 
63 ## sas -stdio < doit.sas > doit.lst 2> doit.log
64 ## 
65 ## To redirect the SAS Log and Output under the C-Shell, use the
66 ## following command:   
67 ## 
68 ## (sas -stdio < doit.sas > doit.lst) >& doit.log
69
70 ## From WWW.SAS.COM:
71 ## How can I make SAS in batch mode behave like interactive SAS,
72 ## continue running my SAS job, and not enter syntax check mode when
73 ## it encounters an error?
74 ##
75 ## You can specify the NOSYNTAXCHECK option when you invoke your SAS
76 ## program.