SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 591|回复: 0
打印 上一主题 下一主题

产生的RTF有问题 请教如何解决

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 2009-3-13 13:02:15 | 只看该作者

产生的RTF有问题 请教如何解决

[code:1nholnho]proc format library=work ;
    value greek
             1 = '61'x /* Lowercase Alpha  */
             2 = '62'x /* Lowercase Beta   */
             3 = '63'x /* Lowercase Chi   */
             4 = '6c'x /* Lowercase Lambda  */
             5 = '71'x /* Lowercase Theta  */
      other = 'A5'x /* Infinity        */ ;
    value greekx /* Used to help understand the results */
             1 = 'ALPHA'
             2 = 'BETA'
             3 = 'CHI'
             4 = 'LAMBDA'
             5 = 'THETA'
    other = 'INFINITY'  ;
run ; quit ;

ods escapechar = "?"  ;
data work.test ;
    do Unformatted = 1 to 6 ;
        * Insert the Greek symbol into a variable value, along with escape character and the font required ;
      Special_Var = 'Special character '       !!
            trim(put(unformatted,greekx.))       !!
            ' "?S={font_face=symbol}'             !!
            trim(put(unformatted,greek.))        !!
            '?S={ }" in Data Values' ;
       output ;
    end ;
run ;
ods listing close ;
ods rtf file = 'c:\Special_Characters.rtf' ;
title font="Times New Roman" 'Special character Infinity "'
    font="Symbol"     'A5'x
    font="Times New Roman" '" in Title' ;
proc report data=work.test nowd ;
   column unformatted unformatted=Greekx unformatted=Greek Special_Var ;
   define unformatted / 'Unformatted/Value' ;
   define Greekx / 'Symbol' format=greekx. ;
   define Greek / 'Greek/Character' format=greek.
      style(column)={font_face=Symbol} ;
* To insert a symbol into a label, the LABEL statement must be used, rather than a DEFINE statement. The label must be one continuous string and should not contain any line breaks, but it may appear that it does in this document ;
label special_var='Special character /Infinity "?S={font_face=Symbol}'"A5"x'?S={ }" /in Variable Label' ;
run ;
proc tabulate data=work.test ;
   class special_var ;
   var unformatted ;
   table special_var,
       (unformatted='Greek Symbol' * [style=[font_face=symbol]]
             * f=greek. * sum=' ') ;
* The label must be one continuous string and should not contain any line breaks, but it may appear that it does in this document ;
label special_var = 'Special character Infinity ?S={font_face=symbol}'"A5"x'?S={ } in Variable Label' ;
run;
ods rtf close ;
ods listing ;
[/code:1nholnho]


产生的RTF有问题 请教如何解决
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2026-2-5 12:16 , Processed in 0.066184 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表