请选择 进入手机版 | 继续访问电脑版
楼主: 缘味奶茶
19903 25

sas ods 输出格式 [推广有奖]

heperwong 发表于 2013-5-8 14:30
title  j=l "w" j=c "hai" j=r "f";;  如果你不想3行,你可以写成title j=l  "w    hai    f";这样就成了一 ...
这样虽然在一行了,但是也不是我想要的格式,主要是希望如图所示,能够分单元格显示,并且设置title的字体大小,而程序这样出来的是在同一单元格 PCKVCY}VZFRST]VNKT_CS.jpg

使用道具

heperwong 发表于 2013-5-8 14:30
title  j=l "w" j=c "hai" j=r "f";;  如果你不想3行,你可以写成title j=l  "w    hai    f";这样就成了一 ...
这样虽然在同一行了,但是不是分单元格显示的,能否分两个单元格显示,并且设置显示格式,如顶楼图上所示

使用道具

heperwong 发表于 2013-5-8 15:56:05 |显示全部楼层 |坛友微信交流群
proc template;
define style mystyle;
parent=styles.default;
style usertext from usertext /
foreground=red;
end;
run;

你可以把这一段修改成
proc template;
define style mystyle;
parent=styles.default;
style usertext from usertext /
foreground=red;
style systemtitle /
backgroundcolor=white
fontsize=7
fontstyle=italic
color=red;
end;
run;

就可以控制字体大小,颜色,背景,字体格式,如果涉及到其他关于字体格式的你往里面加条目就OK了。

使用道具

heperwong 发表于 2013-5-8 15:58:56 |显示全部楼层 |坛友微信交流群
至于title跑出来是在一个cell的问题,怎样控制在不同的cell里,这个我也没遇见过。

使用道具

heperwong 发表于 2013-5-8 15:58
至于title跑出来是在一个cell的问题,怎样控制在不同的cell里,这个我也没遇见过。
ok,多谢啦

使用道具

邓贵大 发表于 2013-5-8 17:25:31 |显示全部楼层 |坛友微信交流群
How about output the 1st 3 rows as column headers instead of titles?
Be still, my soul: the hour is hastening on
When we shall be forever with the Lord.
When disappointment, grief and fear are gone,
Sorrow forgot, love's purest joys restored.

使用道具

邓贵大 发表于 2013-5-8 17:25
How about output the 1st 3 rows as column headers instead of titles?
The key is that how to output the 1st 3 rows as column headers , should i add the message to the sas data , furthermore,can 2 or more rows as column headers  at the same time?

使用道具

邓贵大 发表于 2013-5-9 11:18:16 |显示全部楼层 |坛友微信交流群
缘味奶茶 发表于 2013-5-9 10:06
The key is that how to output the 1st 3 rows as column headers , should i add the message to the s ...
Yeah, for example.
  1. ods tagsets.excelxp file='hell.xls';
  2. proc report data=sashelp.class nowd;
  3. column ('Title 1'
  4.                 ('Title 2'
  5.                 ('Title 3.1' name sex) ('Title 3.2' height weight)
  6.                 )
  7.                 );
  8. run;
  9. ods tagsets.excelxp close;
复制代码
已有 2 人评分论坛币 学术水平 热心指数 信用等级 收起 理由
wpfwxn + 5 + 1 精彩帖子
jingju11 + 5 + 5 + 5 精彩帖子

总评分: 论坛币 + 5  学术水平 + 6  热心指数 + 5  信用等级 + 5   查看全部评分

Be still, my soul: the hour is hastening on
When we shall be forever with the Lord.
When disappointment, grief and fear are gone,
Sorrow forgot, love's purest joys restored.

使用道具

缘味奶茶 发表于 2013-5-10 11:03:11 |显示全部楼层 |坛友微信交流群
邓贵大 发表于 2013-5-9 11:18
Yeah, for example.
Thank you for your help, however I would like to know whether can some of the headers be left while the others are center , just like the image shows ?

使用道具

邓贵大 发表于 2013-5-10 22:52:10 |显示全部楼层 |坛友微信交流群
A bit more work with inline formatting
  1. options nodate nonumber;
  2. title1;
  3. ods html file='hell.xls' ;
  4. proc report data=sashelp.class nowd
  5. ;
  6. column ('Title 1'
  7.                 ('Title 2'
  8.                 ("(*ESC*){raw <p align=left>Enter Monsieur}" name sex)
  9.                 ('(*ESC*){raw <div align=left>}Lay down your load' height weight)
  10.                 )
  11.                 );
  12. run;
  13. ods _all_ close;
复制代码
Could be more straightforward if you define the headers in a table style.
Be still, my soul: the hour is hastening on
When we shall be forever with the Lord.
When disappointment, grief and fear are gone,
Sorrow forgot, love's purest joys restored.

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-3-29 19:48