sas程序
快捷键:
F3 运行
Ctrl+e 清空
Ctrl+o 打开文件快捷键
注释
------;
/-----------*/
RUN
上下文: [GLOBAL STATEMENT] RUN 语句
Syntax: RUN ;
Executes the previously entered SAS statements.
Although the RUN statement is not required between steps in a SAS program, using it creates
a step boundary and can make the SAS log easier to read.
Arguments:
CANCEL
terminates the current step without executing it. SAS prints a message that indicates that the step was not executed.
CAUTION:
The CANCEL option does not prevent execution of a DATA step that contains a DATALINES or DATALINES4 statement.
CAUTION:
The CANCEL option has no effect when you use the KILL option with PROC DATASETS.
数据步 data
data ngj.test; #data开头;
.....
.....
run;(quit;) #执行;
过程步 proc
proc print; #proc开头;
title'hello world'
run;(quit;) #执行;
文件名
data a;
生成一个a命名的数据集
file print;把本来在日志窗口显示的在输窗口显示
put ‘hello world’ 把引号内内容在日志窗口显示出来
run;
proc print;
run;
proc sort ;data=oranges
run;
libname file_name(自定义文件名称用于存放在sas中,或者使用历史已经定义好的文件名) 地址(文件在电脑中的物理地址)
data file_name.(wenjainming )需要自己定义
例:
libname ngj BASE “F:\WORKSPACE\RISK\niuguangjie”;
data ngj.test;
set apply_20190730;
by apply_no;
run;
一句话,put把数字变成文本,input则反之。
input介绍:
input 后面添加要查看的变量名称 负责生成变量的
input x1-x5 意思是从x1到x5 [x1 x2 x3 x4 x5]
x6 $ :意思是x6为字符串形式的变量
date yymmdd15. :意思是date为日期形式的变量 占15位
x7 = 'o' :表示字符串
x8 = 'i am a student' :表示字符串
cards:
后面接数据va