SAS Proc 报告特定设置

SAS Proc Report Specific Setup

我想使用过程报告来构建显示而不是简单的过程打印。我的数据是这样的。

A      B            C      D
Bill   Harry        Bog    The
Bill   Harry        Hog    Quick
Bill   Harry        Log    Brown
Bill   Hermione     Bog    Fox
Bill   Hermione     Hog    Jumps
Bill   Hermione     Log    Over
Bill   Ron          Bog    The
Bill   Ron          Hog    Lazy 
Bill   Ron          Log    Dogs
Ted    Harry        Bog    Peter
Ted    Harry        Hog    Piper
Ted    Harry        Log    Picked
Ted    Hermione     Bog    A
Ted    Hermione     Hog    Powerful
Ted    Hermione     Log    Peck
Ted    Ron          Bog    Of
Ted    Ron          Hog    Picked
Ted    Ron          Log    Peppers

我希望最终输出如下所示:

A      B           Bog      Hog      Log
Bill   Harry       The      Quick    Brown
       Hermione    Fox      Jumps    Over
       Ron         The      Lazy     Dogs

Ted    Harry       Peter    Piper    Picked
       Hermione    A        Powerful Peck
       Ron         Of       Pickled   Peppers

所有变量都是字符。

如何在过程报告中设置它?我与组、跨等的各种组合很接近,但我似乎从来没有完全理解这一点。我是 proc 报告的新手,任何帮助表示赞赏。

下次 post 您尝试过的 Proc REPORT 代码,以便我们了解您的想法。

使用逗号运算符堆叠列 c 和 d,并使用隐藏统计信息强制堆叠。

proc report data=foo;
  columns a b c,d n;
  define a / group;
  define b / group;
  define c / across;
  define d / display;
  define n / noprint;
run;

推荐阅读:跨越PROC REPORT中的障碍。 Cynthia L. Zender,SAS Institute Inc.,北卡罗来纳州卡里