목차
1. 자료의 종류
2. PROC
1. Basic SAS PROCs
2. PROC 과 함께 사용되는 문장들
3. PROC PRINT
4. PROC REPORT
5. HTML Output 생성 (ODS 사용)
2. PROC
1. Basic SAS PROCs
2. PROC 과 함께 사용되는 문장들
3. PROC PRINT
4. PROC REPORT
5. HTML Output 생성 (ODS 사용)
본문내용
r age;
run;
ODS 일반 사용형식
1. 시작
ods output-format;
2. 끝
ods output-format close;
============= ============
output format 생성
============= ============
OUTPUT SAS data sets
Listing listing output default
HTML HTML output
============= =============
ODS HTML 형식
ODS HTML
HTML-file-spec(s) options;
ODS HTML CLOSE;
HTML file 형식 (4가지)
BODY= or FILE= PROC 결과를 저장하는 file
CONTENTS= TOC(table of contents) file 생성(toc.html)
(body file과 link)
FRAME= frame file 생성(frame.html)
PAGE=
options
PATH=
STYLE=
ex) Body file 생성
ods html body=\'c:\\work\\admit.html\';
proc print data=clinic.admit label;
var sex age height weight actlevel;
label actlevel=\'Activity Level\'; run;
ods html close;
위 program을 수행하면 proc의 결과가 browser와 OUTPUT window에 나타난다.
HTML output을 생성하기 전에 Listing destination을 close 시키면 결과가 HTML output 에만 나타남 (ods listing close;)
By default,
the Listing destination is open
the OUTPUT and HTML destinations are closed.
ex)
ods listing close;
ods html file =\'c:\\work\\data.html\'
contents =\'c:\\work\\toc.html\'
frame =\'c:\\work\\frame.html\';
proc print data=clinic.admit lable;
var sex age height weight actlevel;
label actlevel=\'Activity level\';
run;
proc print data=clinic.stress2;
var id resthr maxhr rechr; run;
ods html close;
ods listing;
TOC link - URL 지정
일반형식
URL= suboption in a file spec.
HTML-file-spec (URL=\'uniform-resource-locator\')
예) 상대(relative) URLs
ods html body=\'c:\\work\\data.html\' (url=\'data.html\')
contents=\'c:\\work\\toc.html\' (url=\'toc.html\')
frame=\'c:\\work\\frame.html\';
예) 절대(absolute) URLs
ods html body=\'c:\\work\\data.html\'
(url=\'http://mysite.com/myreports/data.html\')
contents=\'c:\\work\\toc.html\'
(url=\'http://mysite.com/mycontents/toc.html\')
frame=\'c:\\work\\frame.html\';
HTML Output 색갈변경
일반형식
STYLE=option;
option : Beige, Brick(default), Brown, D3D, Default, Minimal etc
SAS에서 가능한 Style 보는법
Result folder에서 오른쪽 mouse click, 서식파일 선택
-> Sashelp.Tmplmst -> Styles folder
ex) style=
ods listing close;
ods html body=\'c:\\work\\data.html\' (url=\'data.html\')
contents=\'c:\\work\\toc.html\' (url=\'toc.html\')
frame=\'c:\\work\\frame.html\'
style=brown;
proc print data=clinic.admit label;
var id sex age height weight actlevel;
label actlevel=\'Activity level\';
run;
proc print data=clinic.stress2;
var id resthr maxhr rechr;
run;
ods html close;
ods listing;
Output path 지정
일반형식
PATH=option
예)
ods listing close;
ods html path=\'c:\\work\' (url=none)
body=\'data.html\' (url=\'data.html\')
contents=\'toc.html\' (url=\'toc.html\')
frame=\'frame.html\'
style=brick;
proc print data=clinic.admit label;
var id sex age height weight actlevel;
label actlevel=\'Activity level\';
run;
proc print data=clinic.stress2;
var id resthr maxhr rechr;
run;
ods html close;
ods listing;
ods listing close;
ods html path=\'c:\\work\' (url=none)
body=\'data.html\'
contents=\'toc.html\'
frame=\'frame.html\'
style=brick;
proc print data=clinic.admit label;
var id sex age height weight actlevel;
label actlevel=\'Activity level\';
run;
proc print data=clinic.stress2;
var id resthr maxhr rechr;
run;
ods html close;
ods listing;
run;
ODS 일반 사용형식
1. 시작
ods output-format
2. 끝
ods output-format close;
============= ============
output format 생성
============= ============
OUTPUT SAS data sets
Listing listing output default
HTML HTML output
============= =============
ODS HTML 형식
ODS HTML
HTML-file-spec(s) options;
ODS HTML CLOSE;
HTML file 형식 (4가지)
BODY= or FILE= PROC 결과를 저장하는 file
CONTENTS= TOC(table of contents) file 생성(toc.html)
(body file과 link)
FRAME= frame file 생성(frame.html)
PAGE=
options
PATH=
STYLE=
ex) Body file 생성
ods html body=\'c:\\work\\admit.html\';
proc print data=clinic.admit label;
var sex age height weight actlevel;
label actlevel=\'Activity Level\'; run;
ods html close;
위 program을 수행하면 proc의 결과가 browser와 OUTPUT window에 나타난다.
HTML output을 생성하기 전에 Listing destination을 close 시키면 결과가 HTML output 에만 나타남 (ods listing close;)
By default,
the Listing destination is open
the OUTPUT and HTML destinations are closed.
ex)
ods listing close;
ods html file =\'c:\\work\\data.html\'
contents =\'c:\\work\\toc.html\'
frame =\'c:\\work\\frame.html\';
proc print data=clinic.admit lable;
var sex age height weight actlevel;
label actlevel=\'Activity level\';
run;
proc print data=clinic.stress2;
var id resthr maxhr rechr; run;
ods html close;
ods listing;
TOC link - URL 지정
일반형식
URL= suboption in a file spec.
HTML-file-spec (URL=\'uniform-resource-locator\')
예) 상대(relative) URLs
ods html body=\'c:\\work\\data.html\' (url=\'data.html\')
contents=\'c:\\work\\toc.html\' (url=\'toc.html\')
frame=\'c:\\work\\frame.html\';
예) 절대(absolute) URLs
ods html body=\'c:\\work\\data.html\'
(url=\'http://mysite.com/myreports/data.html\')
contents=\'c:\\work\\toc.html\'
(url=\'http://mysite.com/mycontents/toc.html\')
frame=\'c:\\work\\frame.html\';
HTML Output 색갈변경
일반형식
STYLE=option;
option : Beige, Brick(default), Brown, D3D, Default, Minimal etc
SAS에서 가능한 Style 보는법
Result folder에서 오른쪽 mouse click, 서식파일 선택
-> Sashelp.Tmplmst -> Styles folder
ex) style=
ods listing close;
ods html body=\'c:\\work\\data.html\' (url=\'data.html\')
contents=\'c:\\work\\toc.html\' (url=\'toc.html\')
frame=\'c:\\work\\frame.html\'
style=brown;
proc print data=clinic.admit label;
var id sex age height weight actlevel;
label actlevel=\'Activity level\';
run;
proc print data=clinic.stress2;
var id resthr maxhr rechr;
run;
ods html close;
ods listing;
Output path 지정
일반형식
PATH=option
예)
ods listing close;
ods html path=\'c:\\work\' (url=none)
body=\'data.html\' (url=\'data.html\')
contents=\'toc.html\' (url=\'toc.html\')
frame=\'frame.html\'
style=brick;
proc print data=clinic.admit label;
var id sex age height weight actlevel;
label actlevel=\'Activity level\';
run;
proc print data=clinic.stress2;
var id resthr maxhr rechr;
run;
ods html close;
ods listing;
ods listing close;
ods html path=\'c:\\work\' (url=none)
body=\'data.html\'
contents=\'toc.html\'
frame=\'frame.html\'
style=brick;
proc print data=clinic.admit label;
var id sex age height weight actlevel;
label actlevel=\'Activity level\';
run;
proc print data=clinic.stress2;
var id resthr maxhr rechr;
run;
ods html close;
ods listing;
소개글