% cp file1 file2 make a copy of file "file1" named "file2" % more file look at "file" a page at a time (use long space bar to page forward) % ls list names of your files in your directory % ls -l long version of "ls" (has dates of last change) % emacs file edit "file" using full screen editor "emacs" % vi file edit "file" using full screen editor "vi" % rm file remove "file" from your directoryWhile it is more efficient in the long run to learn an editor (emacs or vi) on our sytem, it is also possible to work from your local computer and use FTP (that is, Fetch from WiscWorld) to move files back and forth. There are on-line manual pages for commands. For instance, type man rm to find out more about the rm command. There are several good books on UNIX listed on the UNIX Systems page.
The easiest way to run SAS is to store your commands in a file and then pass that file to the sas program. You can either copy one of your instructor's examples, or create your own using emacs or vi. It is a good idea to get in the habit of using the .sas suffix to identify a file of SAS commands. Other standard suffix conventions include:
myfile.sas sas command file (may have data also) myfile.dat data file (if separate from "myfile.sas") myfile.log log of what sas did with your commands myfile.lst output listing of your successful commandsThe myfile name is up to you; use 8 or fewer characters in the name, starting with a letter (a-z). Numbers (0-9) or underscore (_) can be used, but avoid other symbols. (This naming convention applies to SAS variables and datasets as well.) The sas program automatically produces the myfile.log and myfile.lst files for you. All you have to do is type the command
% sas myfile.sasUsually it takes a little while to run. If instead of giving your file you simply typed
% sasthe computer goes into "interactive mode". This is rather complicated and best left to advanced (or adventurous) users. Avoid for now. If you do type this by mistake, simply type the following:
;endsas;(Those are semicolons, the key just to the right of the L key. Follow by a RETURN.) This will get you out of SAS safely. Otherwise, yell for help!
NOTE: Always review the log file before looking at the output listing. It is usually short. Lines with NOTE: are fine and can be helpful in tracing transformations and creation of new variables. Lines with ERROR or WARNING should be heeded: look for the problem somewhere ABOVE the identified line.
options printer options data data input, transformation and manipulation proc procedures for plotting, regression, etc.The options, data steps and some procs (numerical and graphical summaries, plots) are described in the SAS/BASICS book. The other procs (regression, analysis of variance and other fancy stuff) are found in SAS/STAT. SAS reads your file in "free" format--use as many spaces or tabs as you like--but requires a semicolon (;) at the end of each "phrase" or "sentence". It is good practice to indent phrases in data or proc "paragraphs" for ease of reading.
Comments can appear anywhere in your program EXCEPT in the middle of data. Comment lines can begin with an "asterisk (*). Alternatively, a comment paragraph can be surrounded by "slash asterisk" (/*/*) and "asterisk slash" (*/).
* this is a comment line /* this is also a comment line */
OPTIONS can only appear as the first line of myfile.sas. Here is a setup for looking on the screen:
options nocenter linesize=80 pagesize=24;Nice size printer plots do better with the option pagesize=50. Common options include:
nocenter do not center output (flush right instead) linesize=80 set width of page to 80 ls=80 same as linesize pagesize=50 set length of page to 50 ps=24 same as pagesize
Last modified: Tue Jul 25 12:36:05 1995 by Brian Yandell Tue Feb 14 11:10:04 1995 by Stat Www (statwww@stat.wisc.edu)