実行時に文字の出力形式を指定できるようにします。
カテゴリ: | 特殊 |
proc format; value typefmt 1='$groupx' 2='$groupy' 3='$groupz'; value $groupx 'positive'='agree' 'negative'='disagree' 'neutral'='notsure '; value $groupy 'positive'='accept' 'negative'='reject' 'neutral'='possible'; value $groupz 'positive'='pass ' 'negative'='fail' 'neutral'='retest'; run; data answers; length word $ 8; input type response $; respfmt=put(type, typefmt.); word=putc(response, respfmt); datalines; 1 positive 1 negative 1 neutral 2 positive 2 negative 2 neutral 3 positive 3 negative 3 neutral ; proc print data=answers; title 'Using the Third Argument as a Number or Cycle'; run;
agree
です。最終オブザベーションの変数WORDの値はretest
です。
data _null_; length a $20; a='experiment'; y=putc(a,'upcase.-r',20); put '*' y $char20. '*'; put '*' a $upcase20. '*'; run;
* EXPERIMENT* *EXPERIMENT *