6 第一章SAS初阶 事本或其他程序编辑器中把编好的程序存盘,然后 在SAS程序窗口用File菜单的Open命令打开保存好的 程序文件。从SASV8.1开始SAS对中文输入已经消除 了原有的问题所以我们可以直接在SAS程序编辑窗 口输入SAS程序。 要运行此程序,只要用鼠标单击工具栏的提交图标 ,或用Run菜单的Submit命令。运行后,运行记录窗 口出现如下内容: t1t1e)95级1班学生成绩排名; data c9501; 3 input name 1-10 sex math chinese; avg math*0.5+chinese/120*100*0.5: cards; NOTE:The data set WORK.C9501 has 5 observations and 5 variables NOTE:DATA statement used: real time 0.60 seconds 1 12 run; 3 proc print;run; NOTE:There were 5 observations read from the data set WORK.C9501 NOTE:PROCEDURE PRINT used: real time 0.33 seconds 14 proc sort data=c9501; by descending avg; 16 run; NOTE:There were 5 observations read from the data set WORK.C9501. NOTE:The data set WORK.C9501 has 5 observations and 5 variables. NOTE:PROCEDURE SORT used: real time 0.05 seconds 17 proc print;run; NOTE:There were 5 observations read from the data set WORK.C9501 NOTE:PROCEDURE PRINT used: real time 0.00 seconds 其中记录了每段程序的运行情况、所用时间、生 成数据保存情况。如果有错误还会用红色指示错 误。比如,最后的proc print后面的分号如果丢失, 统计软件教程
6 1Ù SASÐ ¯½Ù¦§S?6ì¥r?ЧS, , 3SAS§SI^FileèüOpen·-mÐ §S©"lSAS V8.1m©SAS饩Ñ\®²Ø k¯K¤±·±3SAS§S?6I Ñ\SAS§S" $1d§S, ^àIüÂóä9JãI , ½^RunèüSubmit·-"$1, $1P¹I ÑyXeSNµ 1 title ’95?1Æ)¤1ü¶’; 2 data c9501; 3 input name $ 1-10 sex $ math chinese; 4 avg = math*0.5 + chinese/120*100*0.5; 5 cards; NOTE: The data set WORK.C9501 has 5 observations and 5 variables. NOTE: DATA statement used: real time 0.60 seconds 11 ; 12 run; 13 proc print;run; NOTE: There were 5 observations read from the data set WORK.C9501. NOTE: PROCEDURE PRINT used: real time 0.33 seconds 14 proc sort data=c9501; 15 by descending avg; 16 run; NOTE: There were 5 observations read from the data set WORK.C9501. NOTE: The data set WORK.C9501 has 5 observations and 5 variables. NOTE: PROCEDURE SORT used: real time 0.05 seconds 17 proc print;run; NOTE: There were 5 observations read from the data set WORK.C9501. NOTE: PROCEDURE PRINT used: real time 0.00 seconds Ù¥P¹ zã§S$1¹!¤^m!) ¤êâ¹"XJkج^ùÚ« Ø"'X, proc print¡©ÒXJ¿, ÚO^§