gpt-3.5-turbo-0301· openai
Suzhen/CodeChat
如何用sas画vintage表格
- User
如何用sas画vintage表格
- Assistant
Vintage表格可以使用SAS中的PROC TEMPLATE和ODS语句进行绘制。下面是一个示例代码,用于绘制一个简单的Vintage表格:
/* 创建数据 */ data vintage; input year vintage_value @@; datalines; 2010 250 2011 300 2012 350 2013 400 2014 450 2015 500 2016 550 2017 600 2018 650 2019 700 ; run; /* 创建模板 */ proc template; define style Vintage; parent=styles.default; style GraphFonts from GraphFonts / 'TitleFont' = ('Times New Roman',14pt,bold) 'FootnoteFont' = ('Times New Roman',12pt) 'LabelFont' = ('Times New Roman',12pt) 'ValueFont' = ('Times New Roman',12pt); end; define table Vintage; cellwidth=50; columnheaders = 1; rowheaders = 1; define header / style=[fontsize=14pt bold]; define rowheader / style=[backgroundcolor=LightGray]; define columnheader / style=[backgroundcolor=LightGray]; define data / style=[backgroundcolor=White]; end; run; /* 配置ODS系统 */ ods listing close; ods escapechar='^'; ods tagsets.tablesonlyhtml body="htmlbody.html" columns=132 options(bitmap_mode='inline' suppress_bylines='yes' suppress_column_headers='no' suppress_footnote='yes' cellpadding='2pt' rules='groups' frame='box'); /* 绘制表格 */ ods tagsets.tablesonlyhtml style=Vintage; proc report data=vintage; columns year vintage_value; define year / display style=rowheader; define vintage_value / display style=data; run; /* 关闭ODS系统 */ ods tagsets.tablesonlyhtml close; ods listing;