2019年9月23日月曜日

PROC ODSTEXT入門: 書式の設定




以下のテキスト出力ステートメントでは「STYLEオプション」でテキストの書式を設定できます。
  • P
  • ITEM
  • HEADING




構文

P   "テキスト"   /   STYLE = [ 書式 ] ;


書式
 指定 設定内容  例 
 FONTFAMILY   フォント  fontfamily='MS P明朝' 
 FONTSIZE  文字サイズ  fontsize=10pt
 FONTWEIGHT  文字の太さ  fontweight=bold 
 FONTSTYLE 斜体等のスタイル  fontstyle=roman
 COLOR 文字色 color = blue
 BACKGROUNDCOLOR   セル色 backgroundcolor = yellow
 ・・・ など




proc odstext;
   h1 "食欲の秋" / style=[color=yellow fontsize=20pt];
   p   "栗"            / style=[color=brown fontsize=50pt];
   p   "柿"            / style=[color=orange fontsize=20pt];
run;






また、条件によって書式を設定したい場合「CELLSTYLE-ASステートメント」が使えます。


構文

CELLSTYLE  条件1  AS  { 書式1 },
                       条件2  AS  { 書式2 },
                       条件3  AS  { 書式3 },
                        ・・・
;




proc odstext data=sashelp.class;
list;
   cellstyle age=12 as {color=orange},
                  age=13 as {color=red};
   item strip(put(age,best16.)) || ", " || name;
end;
run;



上の例では、
  • 「AGE=12」だったら「文字色をOrange」に
  • 「AGE=13」だったら「文字色をRed」に
  • それ以外は書式指定なし
としています。




記事一覧

1. 基本構文
3. 見出しの設定
4. 書式の設定


0 件のコメント:

コメントを投稿