码迷,mamicode.com
首页 > 数据库 > 详细

sas中的sql(8)sql选项解析,数据字典

时间:2014-11-19 00:18:19      阅读:299      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   io   ar   color   os   使用   

 

bubuko.com,布布扣

bubuko.com,布布扣

bubuko.com,布布扣

bubuko.com,布布扣

 

INOBS/OUTOBS=

这个选项意思在前面的随笔中已说过,就INOBS这里有个例子

这里的INOBS=5是针对于两张表分别读入5个,而不是一共读入五个

bubuko.com,布布扣

 

NUMBER/NONUMBER

效果如下

bubuko.com,布布扣

 

Double/NoDouble

Double Spacing your output to make it easier to read.

 

FLOW | NOFLOW | FLOW=n | FLOW=n m

The FLOW option causes text to be flowed in its column instead of wrapping the entire row

n sets the width of the flowed column

n m使得列的宽度在n - m之间

 

STIMER | NOSTIMER

NOSTIMER为默认,当为默认时效果如下

两个select语句的运行时间被一起计算,没有起到比较的效果

bubuko.com,布布扣

使用STIMER后,起到了比较的效果

bubuko.com,布布扣

 

Resetting Options

bubuko.com,布布扣

You can use the RESET statement to add, drop, or change PROC SQL options without reinvoking the SQL procedure.

添加

proc sql outobs=5;
select flightnumber, destination
from sasuser.internationalflights;
reset number;
select flightnumber, destination
from sasuser.internationalflights
where boarded gt 200;
quit;

删除

proc sql number;
select name, address, city, state, zipcode
from sasuser.frequentflyers;
reset nonumber;
select name, address, city, state, zipcode
from sasuser.frequentflyers
where pointsearned gt 7000
and pointsused lt 3000;
quit;

 

数据字典

Dictionary tables are special, read-only SAS tables that contain information about SAS data libraries, SAS macros, and external files that are in use or available in the current SAS session.
Dictionary tables also contain the settings for SAS system options and SAS titles and footnotes that are currently in effect

Dictionary table by referring to the PROC SQL view of the table that is stored in the Sashelp library.

bubuko.com,布布扣

 

使用数据字典

proc sql;
    describe table dictionary.tables;
quit;
/*这里是一部分关于表的描述信息*/
create
table DICTIONARY.TABLES ( libname char(8) label=Library Name, memname char(32) label=Member Name, memtype char(8) label=Member Type, dbms_memtype char(32) label=DBMS Member Type, memlabel char(256) label=Data Set Label, typemem char(8) label=Data Set Type, crdate num format=DATETIME informat=DATETIME label=Date Created, modate num format=DATETIME informat=DATETIME label=Date Modified, nobs num label=Number of Physical Observations, obslen num label=Observation Length, nvar num label=Number of Variables, protect char(3) label=Type of Password Protection, compress char(8) label=Compression Routine, encrypt char(8) label=Encryption,
.......
);
/*我们选择库SASUSER中的所有表,以及他们的观测值数量,变量数,和建表日期等变量*/
proc
sql; select memname format=$20., nobs, nvar, crdate from dictionary.tables where libname=SASUSER;
/*查询SASUSER库中含有列EmpID的所有表名*/
proc
sql; select memname from dictionary.columns where libname=SASUSER and name=EmpID;

 

sas中的sql(8)sql选项解析,数据字典

标签:des   style   blog   http   io   ar   color   os   使用   

原文地址:http://www.cnblogs.com/yican/p/4105807.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!