SAS Advanced programming 정리- PROC SQL (6)

Hoya Jaeho Lee·2022년 4월 10일
0

SAS Advanced programming

목록 보기
6/17

Chapter 6 - Creating and Managing Indexes Using PROC SQL

Creating an Index

Example: Creating a Simple Index

proc sql;
create unique index EmpID
on work.payrollmaster(empid);

Example: Creating a Composite, Unique Index

proc sql;
create unique index daily
on work.marchflights(flightnumber,date);

코드 설명:
daily라는 composite index

Displaying Index Specifications

proc sql;
describe table marchflights;

Determining Whether SAS Is Using an Index

options msglevel=i;
proc sql;
select *
from marchflights
where flightnumber='182';
quit;

Example: Dropping a Composite Index
proc sql;
drop index daily
from work.marchflights;


Directing SAS to Ignore All Indexes

proc sql;
select *
from marchflights (idxwhere=no)
where flightnumber='182';
quit;

Directing SAS to Use a Specified Index
proc sql;
select *
from marchflights (idxname=daily)
where flightnumber='182';
quit;

profile
Biostatistics researcher Github: https://github.com/hoyajhl

0개의 댓글