Initial Commit
[packages] / xemacs-packages / ess / texi / help-sas.texi
1 ESS[SAS] was designed for use with SAS.  It is descended from emacs 
2 macros developed by John Sall for editing SAS programs and SAS-mode by 
3 Tom Cook.  Those editing features and new advanced features are part of 
4 ESS[SAS].  The user interface of ESS[SAS] has similarities with ESS[S]
5 and the SAS Display Manager.
6
7 @comment  node-name,  next,  previous,  up
8 @node ESS(SAS)--Design philosophy, ESS(SAS)--Editing files, ESS for SAS, ESS for SAS
9 @section ESS[SAS]--Design philosophy
10
11 ESS[SAS] was designed to aid the user in writing and maintaining
12 SAS programs, such as myfile.sas.  Both interactive and batch submission
13 of SAS programs is supported.   
14
15 ESS[SAS] was written with two primary goals.
16
17 1. The emacs text editor provides a powerful and flexible development
18 environment for programming languages.  These features are a boon to all
19 programmers and, with the help of ESS[SAS], to SAS users as well.
20
21 2. Although a departure from SAS Display Manager, ESS[SAS] provides
22 similar key definitions to give novice ESS[SAS] users a head start.
23 Also, inconvenient SAS Display Manager features, like remote submission
24 and syntax highlighting, are provided transparently; appealing to
25 advanced ESS[SAS] users.
26
27 @comment  node-name,  next,  previous,  up
28 @node ESS(SAS)--Editing files, ESS(SAS)--TAB key, ESS(SAS)--Design philosophy, ESS for SAS
29 @section ESS[SAS]--Editing files
30
31 ESS[SAS] is the mode for editing SAS language files.  This mode handles:
32
33 @display
34 - proper indenting, generated by both [Tab] and [Return].
35 - color and font choices based on syntax.
36 - ability to send the contents of an entire buffer, a highlighted region,
37   or a single line to an interactive SAS process.
38 - ability to switch between processes which would be the target of the
39   buffer (for the above).
40 - ability to save and submit the file you are working on as a batch SAS
41   process with a single keypress and to continue editing while it is runs
42   in the background.
43 - capability of killing the batch SAS process through the shell buffer or
44   allow the SAS process to keep on running after you exit emacs.
45 - single keypress navigation of .sas, .log and .lst files (.log and .lst
46   files are automatically refreshed with each keypress).
47 @end display
48
49 ESS[SAS] is automatically turned on when editing a file with a .sas 
50 suffix (or other extension, if specified via auto-mode-alist).  The function
51 keys can be enabled to use the same function keys that
52 the SAS Display Manager does.  The interactive capabilities of ESS require you 
53 to start an inferior SAS process with M-x SAS
54 (@xref{iESS(SAS)--Interactive SAS processes}.)
55
56 At this writing, the indenting and syntax highlighting are generally
57 correct.  Known issues: for multiple line * or %* comments, only the
58 first line is highlighted; for .log files, only the first line of a
59 NOTE:, WARNING: or ERROR: message is highlighted; unmatched
60 single/double quotes in CARDS data lines are NOT ignored; in a DO ... TO
61 or a DO ... TO ... BY statement, TOs are not highlighted (and neither is
62 BY).
63
64 @comment  node-name,  next,  previous,  up
65 @node  ESS(SAS)--TAB key, ESS(SAS)--Batch SAS processes, ESS(SAS)--Editing files, ESS for SAS
66 @section ESS[SAS]--TAB key
67
68 Two options.  The TAB key is bound by default to sas-indent-line.  This
69 function is used to syntactically indent SAS code so PROC and RUN are in
70 the left margin, other statements are indented 4 spaces from the margin,
71 continuation lines are indented 4 spaces in from the beginning column of
72 that statement.  This is the type of functionality that emacs provides
73 in most programming language modes.  This functionality is equivalent to
74 uncommenting the following line in ess-site.el:
75 @example
76 (setq ess-sas-edit-keys-toggle nil)
77 @end example
78
79 ESS provides an alternate behavior for the TAB key that makes it behave
80 as it does in SAS Display Manager, i.e. move the cursor to the next tab
81 stop.  The alternate behavior also provides a backwards TAB, C-TAB, that
82 moves the cursor to the tab stop to the left and deletes any characters
83 between them.  This functionality is obtained by uncommenting the
84 following line in ess-site.el:
85 @example
86 (setq ess-sas-edit-keys-toggle t)
87 @end example
88 Under the alternate behavior, the TAB key is bound to tab-to-tab-stop
89 and the tab stops are set at multiples of sas-indent-width.
90
91 @comment  node-name,  next,  previous,  up
92 @node  ESS(SAS)--Batch SAS processes, ESS(SAS)--Function keys for batch processing, ESS(SAS)--TAB key, ESS for SAS
93 @section ESS[SAS]--Batch SAS processes
94
95 Submission of a SAS batch job is dependent on your environment.
96 ess-sas-submit-method is determined by your operating system and your
97 shell.  It defaults to 'sh unless you are running Windows or Mac
98 Classic.  Under Windows, it will default to 'sh if you are using a
99 Unix-imitating shell; otherwise 'ms-dos for an MS-DOS shell.  On Mac OS
100 X, it will default to 'sh, but under Mac Classic AppleScript is used
101 ('apple-script).  You will also set this to 'sh if the SAS batch job
102 needs to run on a remote machine rather than your local machine.  This
103 works transparently if you are editing the remote file via ange-ftp/EFS
104 or tramp.  Note that ess-sas-shell-buffer-remote-init is a Local
105 Variable that defaults to "ssh" which will be used to open the buffer on
106 the remote host and it is assumed that no password is necessary,
107 i.e. you are using the equivalent of ssh-agent/ssh-add (see the
108 discussion about Local Variables below if you need to change the
109 default).
110
111 However, if you are editing the file locally and transferring it back
112 and forth with Kermit, you need some additional steps.  First, start
113 Kermit locally before remotely logging in.  Open a local copy of the
114 file with the ess-kermit-prefix character prepended (the default is
115 "#").  Execute the command ess-kermit-get which automatically brings the
116 contents of the remote file into your local copy.  If you transfer files
117 with Kermit manually in a shell buffer, then note that the Kermit escape
118 sequence is C-q C-\ c rather than C-\ c which it would be in an ordinary
119 terminal application, i.e. not in an emacs buffer.  Lastly, note that
120 the remote Kermit command is specified by ess-kermit-command.
121
122 The command used by the SUBMIT function key (F3 or F8) to submit a batch
123 SAS job, whether local or remote, is ess-sas-submit-command which
124 defaults to sas-program.  sas-program is "invoke SAS using program file"
125 for Mac Classic and "sas" otherwise.  However, you may have to alter
126 ess-sas-submit-command for a particular program, so it is defined as
127 buffer-local.  Conveniently, it can be set at the end of the program:
128 @example
129 endsas;
130 Local variables:
131 ess-sas-submit-command: "sas8"
132 End:
133 @end example
134
135 The command line is also made of ess-sas-submit-pre-command, 
136 ess-sas-submit-post-command and ess-sas-submit-command-options 
137 (the last of which is also buffer-local).
138 Here are some examples for your .emacs file (you may also use 
139 M-x customize-variable):
140 @example
141 ;'sh default
142 (setq ess-sas-submit-pre-command "nohup")                 
143 ;'sh default
144 (setq ess-sas-submit-post-command "-rsasuser &")          
145 ;'sh example
146 (setq-default ess-sas-submit-command "/usr/local/sas/sas")        
147 ;'ms-dos default
148 (setq ess-sas-submit-pre-command "start")                 
149 ;'ms-dos default
150 (setq ess-sas-submit-post-command "-rsasuser -icon")      
151 ;Windows example
152 (setq-default ess-sas-submit-command "c:/progra~1/sas/sas.exe")   
153 ;Windows example
154 (setq-default ess-sas-submit-command "c:\\progra~1\\sas\\sas.exe")
155 @end example
156
157 There is a built-in delay before a batch SAS job is submitted when using
158 a Unix-imitating shell under Windows.  This is necessary in many cases 
159 since the shell might not be ready to receive a command.  This delay is 
160 currently set high enough so as not to be a problem.  But,
161 there may be cases when it needs to be set higher, or could be set much
162 lower to speed things up.  You can over-ride the default in your .emacs
163 file by:
164 @example
165 (setq ess-sleep-for 0.2)
166 @end example
167
168 For example, open the file you want to work with 
169 (ess-sas-global-unix-keys keys shown, ess-sas-global-pc-keys in 
170 parentheses; ESS[SAS] function keys are presented in the next section).
171 @example
172 C-x C-f myfile.sas
173 @end example
174 myfile.sas will be in ESS[SAS] mode.  Edit as appropriate, then save and 
175 submit the batch SAS job.
176 @example
177 F3 (F8)
178 @end example
179 The job runs in the shell buffer while you continue to edit 
180 myfile.sas.  If ess-sas-submit-method is 'sh, then the 
181 message buffer will display the shell notification when the 
182 job is complete.  The 'sh setting also allows you to 
183 terminate the SAS batch job before it is finished.
184 @example
185 F8 (F3)
186 @end example
187 Terminating a SAS batch in the *shell* buffer.
188 @example
189 kill %1
190 @end example
191 You may want to visit the .log (whether the job is still running 
192 or it is finished) and check for error messages.  The .log will be
193 refreshed and you will be placed in it's buffer.  You will be 
194 taken to the 1st error message, if any.  
195 @example
196 F5 (F6)
197 @end example
198 Goto the next error message, if any.
199 @example
200 F5 (F6)
201 @end example
202 Now, refresh the .lst and go to it's buffer.
203 @example
204 F6 (F7)
205 @end example
206 If you wish to make changes, go to the .sas file with.
207 @example
208 F4 (F5)
209 @end example
210 Make your editing changes and submit again.
211 @example
212 F3 (F8)
213 @end example
214
215 @comment  node-name,  next,  previous,  up
216 @node  ESS(SAS)--Function keys for batch processing, iESS(SAS)--Interactive SAS processes, ESS(SAS)--Batch SAS processes, ESS for SAS
217 @section ESS[SAS]--Function keys for batch processing
218
219 The setup of function keys for SAS batch processing
220 is unavoidably complex, but the usage of function keys is simple.  
221 There are five distinct options:
222
223 Option 1 (default).  Function keys in ESS[SAS] are not bound to elisp
224 commands.  This is in accordance with the GNU Elisp Coding Standards
225 (GECS) which do not allow function keys to be bound so that they are
226 available to the user.
227
228 Options 2-5.  Since GECS does not allow function keys to be bound by
229 modes, these keys are often unused.  So, ESS[SAS] provides users with
230 the option of binding elisp commands to these keys.  Users who are
231 familiar with SAS will, most likely, want to duplicate the function key
232 capabilities of the SAS Display Manager.  There are four options (noted
233 in parentheses).
234
235 @enumerate a
236 @item
237 SAS Display Manager has different function key definitions for
238 Unix (2, 4) and Windows (3, 5); ESS can use either.
239 @item
240 The ESS[SAS] function key definitions can be active in all buffers
241 (global: 4, 5) or limited (local: 2, 3) only to buffers with files that
242 are associated with ESS[SAS] as specified in your auto-mode-alist.
243 @end enumerate
244
245 The distinction between local and global is subtle.  If you want the
246 ESS[SAS] definitions to work when you are in the *shell* buffer or when
247 editing files other than the file extensions that ESS[SAS] recognizes,
248 you will most likely want to use the global definitions.  If you want
249 your function keys to understand SAS batch commands when you are editing
250 SAS files, and to behave normally when editing other files, then you
251 will choose the local definitions.  The option can be chosen by the
252 person installing ESS for a site or by an individual.
253
254 @enumerate a
255 @item
256 For a site installation or an individual, uncomment ONLY ONE of the
257 following lines in your ess-site.el.  ESS[SAS] Function keys are
258 available in ESS[SAS] if you uncomment either 2 or 3 and in all modes if
259 you uncomment 4 or 5:
260 @example
261 ;;2; (setq ess-sas-local-unix-keys t)
262 ;;3; (setq ess-sas-local-pc-keys t)
263 ;;4; (setq ess-sas-global-unix-keys t)
264 ;;5; (setq ess-sas-global-pc-keys t)
265 @end example
266
267 The names -unix- and -pc- have nothing to do with the operating system
268 that you are running.  Rather, they mimic the definitions that the SAS
269 Display Manager uses by default on those platforms.
270
271 @item
272 If your site installation has configured the keys contrary to your 
273 liking, then you must call the appropriate function.  
274 @example 
275  (load "ess-site") ;; local-unix-keys
276  (ess-sas-global-pc-keys)
277 @end example
278 @end enumerate
279
280 Finally, we get to what the function keys actually do.  You may recognize
281 some of the nicknames as SAS Display Manager commands (they are in all 
282 capitals).
283
284 @display
285 Unix PC  Nickname   "inferior" Alias (if any) and Description  
286
287 F2   F2  refresh
288                     revert the current buffer with the file of the same 
289                     name if the file is newer than the buffer
290
291 F3   F8  SUBMIT     C-c C-b
292                     save the current .sas file (which is either the .sas 
293                     file in the current buffer or the .sas file associated
294                     with the .lst or .log file in the current buffer) and 
295                     submit the file as a batch SAS job
296
297 F4   F5  PROGRAM       
298                     switch buffer to .sas file
299
300 F5   F6  LOG        C-c C-x
301                     switch buffer to .log file, `refresh' and goto next 
302                     error message, if any
303
304 F6   F7  OUTPUT     C-c C-y
305                     switch buffer to .lst file and `refresh'
306
307 F7   F4  filetype-1    
308                     switch buffer to filetype-1 (defaults to .txt) file 
309                     and `refresh'
310
311 F8   F3  shell      
312                     switch buffer to shell
313
314 F9   F9  VIEWTABLE  
315                     open an interactive FSEDIT/FSBROWSE session on the SAS 
316                     dataset near point
317
318 F10  F10  toggle-log    
319                     toggle ESS[SAS] for .log files; may be useful for 
320                     certain debugging situations
321
322 F11  F11  filetype-2
323                     switch buffer to filetype-2 (defaults to .dat) file 
324                     and `refresh'
325
326 F12  F12  viewgraph
327                     open a GSASFILE near point for viewing either in emacs
328                     or with an external viewer
329
330 C-F1 C-F1 rtf-portrait
331                     create an MS RTF portrait file from the current buffer 
332                     with a file extension of .rtf
333
334 C-F2 C-F2 rtf-landscape
335                     create an MS RTF landscape file from the current buffer 
336                     with a file extension of .rtf
337
338 C-F3 C-F8 submit-region C-c C-r 
339                     write region to ess-temp.sas and submit
340
341 C-F5 C-F6 append-to-log    
342                     append ess-temp.log to the current .log file
343
344 C-F6 C-F7 append-to-output 
345                     append ess-temp.lst to the current .lst file
346
347 C-F9 C-F9 INSIGHT 
348                     open an interactive INSIGHT session on the SAS 
349                     dataset near point
350
351 C-F10 C-F10 kill-em-all
352                     kill all buffers associated with a .sas program
353 @end display
354
355 SUBMIT, PROGRAM, LOG and OUTPUT need no further explanation since
356 they mimic the SAS Display Manager function key definitions.  However, six 
357 other keys have been provided for convenience and are described below.
358
359 `shell' switches you to the *shell* buffer where you can interact with
360 your operating system.  This is especially helpful if you would like to 
361 kill a SAS batch job.  You can specify a different buffer name to 
362 associate with a SAS batch job (besides *shell*) with the buffer-local 
363 variable ess-sas-shell-buffer.  This allows you to have multiple 
364 buffers running SAS batch jobs on multiple local/remote computers
365 that may rely on different methods specified by the buffer-local variable
366 ess-sas-submit-method.
367
368 F2 performs the `refresh' operation on the current buffer.  `refresh'
369 compares the buffer's last modified date/time with the file's last
370 modified date/time and replaces the buffer with the file if the file is
371 newer.  This is the same operation that is automatically performed when
372 LOG, OUTPUT, `filetype-1' or F11 are pressed.
373
374 `filetype-1' switches you to a file with the same file name as your .sas
375 file, but with a different extension (.txt by default) and performs
376 `refresh'.  You can over-ride the default extension; for example in your
377 .emacs file:
378 @example
379 (setq ess-sas-suffix-1 "csv") ; for example
380 @end example
381
382 F9 will prompt you for the name of a permanent SAS dataset near point to
383 be opened for viewing by PROC FSEDIT.  You can control the SAS batch
384 command-line with ess-sas-data-view-submit-options.  For controlling the
385 SAS batch commands, you have the global variables
386 ess-sas-data-view-libname and ess-sas-data-view-fsview-command as well
387 as the buffer-local variable ess-sas-data-view-fsview-statement.  If you
388 have your SAS LIBNAMEs defined in autoexec.sas, then the defaults for
389 these variables should be sufficient.
390
391 Similarly, C-F9 will prompt you for the name of a permanent SAS dataset
392 near point to be opened for viewing by PROC INSIGHT.  You can control
393 the SAS batch command-line with ess-sas-data-view-submit-options.  For
394 controlling the SAS batch commands, you have the global variables
395 ess-sas-data-view-libname and ess-sas-data-view-insight-command as well
396 as the buffer-local variable ess-sas-data-view-insight-statement. 
397
398 F10 toggles ESS[SAS] mode for .log files which is off by default
399 (technically, it is SAS-log-mode, but it looks the same).  The syntax
400 highlighting can be helpful in certain debugging situations, but large
401 .log files may take a long time to highlight.
402
403 F11 is the same as `filetype-1' except it is .dat by default.  
404
405 F12 will prompt you for the name of a GSASFILE near the point in .log to
406 be opened for viewing either with emacs or with an external viewer.
407 Depending on your version of emacs and the operating system you are
408 using, emacs may support .gif and .jpg files internally.  You may need
409 to change the following variables for your own situation.  
410 ess-sas-graph-view-suffix-regexp is a regular expression of supported 
411 file types defined via file name extensions.  
412 ess-sas-graph-view-viewer-default is the default external viewer for
413 your platform.  ess-sas-graph-view-viewer-alist is an alist of 
414 exceptions to the default; i.e. file types and their associated
415 viewers which will be used rather than the default viewer.
416 @example
417 (setq ess-sas-graph-view-suffix-regexp (concat "[.]\\([eE]?[pP][sS]\\|"
418 "[pP][dD][fF]\\|[gG][iI][fF]\\|[jJ][pP][eE]?[gG]\\|"
419 "[tT][iI][fF][fF]?\\)")) ;; default
420 (setq ess-sas-graph-view-viewer-default "kodakimg") ;; Windows default
421 (setq ess-sas-graph-view-viewer-default "sdtimage") ;; Solaris default
422 (setq ess-sas-graph-view-viewer-alist
423   '(("[eE]?[pP][sS]" . "gv") ("[pP][dD][fF]" . "acroread")) ;; default
424 @end example
425
426 C-F2 produces US landscape by default, however, it can produce A4
427 landscape (first line for "global" key mapping, second for "local"):
428 @example
429 (global-set-key [(control f2)] 'ess-sas-rtf-a4-landscape)
430 (define-key sas-mode-local-map [(control f2)] 'ess-sas-rtf-a4-landscape)
431 @end example
432
433
434 @comment  node-name,  next,  previous,  up
435 @node  iESS(SAS)--Interactive SAS processes, iESS(SAS)--Common problems, ESS(SAS)--Function keys for batch processing, ESS for SAS
436 @section iESS[SAS]--Interactive SAS processes
437
438 iESS (inferior ESS) is the method for interfacing with interactive
439 statistical processes (programs).  iESS[SAS] is what is needed for
440 interactive SAS programming.  iESS[SAS] works best
441 with the following settings for SAS command-line options 
442 (the default of inferior-SAS-args):
443
444 @example
445 -stdio -linesize 80 -noovp -nosyntaxcheck
446 @end example
447
448 @display
449 -stdio          
450             required to make the redirection of stdio work
451 -linesize 80    
452             keeps output lines from folding on standard terminals
453 -noovp          
454             prevents error messages from printing 3 times
455 -nosyntaxcheck  
456             permits recovery after syntax errors
457 @end display
458
459 To start up iESS[SAS] mode, use:
460 @example
461    M-x SAS
462 @end example
463
464 The *SAS:1.log* buffer in ESStr mode corresponds to the file
465 myfile.log in SAS batch usage and to the "SAS: LOG" window in the SAS
466 Display Manager.  All commands submitted to SAS, informative
467 messages, warnings, and errors appear here.
468
469 The *SAS:1.lst* buffer in ESSlst mode corresponds to the file
470 myfile.lst in SAS batch usage and to the "SAS: OUTPUT" window in the
471 SAS Display Manager.  All data related printed output from the
472 PROCs appear in this window.
473
474 The iESS [SAS:1] buffer exists solely as a communications buffer.
475 Files are edited in the myfile.sas buffer.  The C-c C-r key in
476 ESS[SAS] is the functional equivalent of bringing a file into the
477 "SAS: PROGRAM EDITOR" window followed by the 'Local' 'Submit' menu
478 commands.  The user should never use this buffer directly.
479
480 For example, open the file you want to work with.
481 @example
482 C-x C-f myfile.sas
483 @end example
484 myfile.sas will be in ESS[SAS] mode.  Edit as appropriate, and then start 
485 up SAS with the cursor in the myfile.sas buffer.
486 @example
487 M-x SAS
488 @end example
489 Four buffers will appear on screen:
490 @example
491 Buffer          Mode            Description
492 myfile.sas      ESS[SAS]        your source file
493 *SAS:1*         iESS [SAS:1]    ESS communication buffer
494 *SAS:1.log*     Shell [] ESStr  SAS log information
495 *SAS:1.lst*     Shell [] ESSlst SAS listing information
496 @end example
497 If you would prefer each of the four buffers to appear in its
498 own individual frame, you can arrange for that.  Place the
499 cursor in the buffer displaying myfile.sas.  Enter the
500 sequence:
501 @example
502 C-c C-w
503 @end example
504 The cursor will normally be in buffer myfile.sas.
505 If not, put it there:
506 @example
507 C-x b myfile.sas
508 @end example
509 Send regions, lines, or the entire file contents to SAS
510 (regions are most useful).  A highlighted region will normally
511 begin with the keywords 'DATA' or 'PROC' and end with the
512 keyword 'RUN;'
513 @example
514 C-c C-r
515 @end example
516 Information appears in the log buffer, analysis results in the
517 listing buffer.  In case of errors, make the corrections in the
518 myfile.sas buffer and resubmit with another C-c C-r
519
520 At the end of the session you may save the log and listing
521 buffers with the usual C-x C-s commands.  You will be prompted
522 for a file name.  Typically, the names myfile.log and myfile.lst
523 will be used.  You will almost certainly want to edit the saved
524 files before including them in a report.  The files are
525 read-only by default.  You can make them writable by the emacs
526 command C-x C-q.
527
528 At the end of the session, the input file myfile.sas will
529 typically have been revised.  You can save it.  It can be used
530 later as the beginning of another iESS[SAS] session.  It can
531 also be used as a batch input file to SAS.
532
533 The *SAS:1* buffer is strictly for ESS use.  The user should
534 never need to read it or write to it.  Refer to the .lst and
535 .log buffers for monitoring output!
536
537 @c DANGER Will Robinson!
538 @c We plan to add
539 @c @display
540 @c - The ability to request help from a process for variables and
541 @c   functions, and to have the results sent into a separate buffer.
542 @c - completion of object names and file names.
543 @c @end display
544
545 Troubleshooting: @xref{iESS(SAS)--Common problems}.
546
547 @comment  node-name,  next,  previous,  up
548 @node   iESS(SAS)--Common problems, ESS(SAS)--Graphics, iESS(SAS)--Interactive SAS processes, ESS for SAS
549 @section iESS[SAS]--Common problems
550
551 @display
552 1. iESS[SAS] does not work on Windows.  In order to run SAS inside
553    an emacs buffer, it is necessary to start SAS with the -stdio option.
554    SAS does not support the -stdio option on Windows.
555
556 2. If M-x SAS gives errors upon startup, check the following:
557    - you are running Windows:  see 1.
558    - ess-sas-sh-command (in the ESS source directory) needs to be
559      executable (solution: "chmod ugo+rx ess-sas-sh-command").
560    - sas isn't in your executable path (verify using "which sas" from
561      a shell command-line)
562
563 3. M-x SAS starts SAS Display Manager.  Probably, the command "sas" 
564    on your system calls a shell script.  Specify the path to the real 
565    "sas" executable in the file ess-sas-sh-command, i.e.:
566 @example
567 /usr/local/sas612/sas </dev/tty 1>$stdout 2>$stderr $@@
568 @end example
569    To find the "sas" exectuable, you can execute the unix command:
570 @example
571 find / -name sas -print
572 @end example
573 @end display
574
575 @comment  node-name,  next,  previous,  up
576 @node   ESS(SAS)--Graphics, ESS(SAS)--MS Windows, iESS(SAS)--Common problems, ESS for SAS
577 @section ESS[SAS]--Graphics
578
579 Output from GPROCs can be displayed in a SAS/Graph window for SAS batch
580 on Windows or for both SAS batch and interactive with X11 on Unix.  If
581 you need to create graphics files and view them with F12, then include
582 the following (either in myfile.sas or in your autoexec.sas):
583 @example
584 filename gsasfile 'graphics.ps'; 
585 goptions device=ps gsfname=gsasfile gsfmode=append; 
586 @end example
587 PROC PLOT graphs can be viewed in the listing buffer.  You may
588 wish to control the vertical spacing to allow the entire plot
589 to be visible on screen, for example:
590 @example
591 proc plot;
592     plot a*b / vpos=25;
593 run;
594 @end example
595
596 @comment  node-name,  next,  previous,  up
597 @node   ESS(SAS)--MS Windows, , ESS(SAS)--Graphics, ESS for SAS
598 @section ESS[SAS]--MS Windows
599
600 @itemize @bullet
601 @item
602 iESS[SAS] does not work on Windows.  @xref{iESS(SAS)--Common problems}.
603
604 @item
605 ESS[SAS] mode for editing SAS language files works very well.
606 @xref{ESS(SAS)--Editing files}.
607
608 @item
609 There are two execution options for SAS on Windows.
610 You can use batch.  @xref{ESS(SAS)--Batch SAS processes}.
611
612 Or you can mark regions with the mouse and submit the code with
613 `submit-region' or paste them into SAS Display Manager.
614
615 @end itemize
616