【问题标题】:SAS Proc Report Specific SetupSAS Proc 报告特定设置
【发布时间】:2017-09-27 18:33:52
【问题描述】:

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

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 报告中设置它?我很接近组、交叉等的各种组合,但我似乎从来没有完全理解这一点。我是 proc 报告的新手,任何帮助表示赞赏。

【问题讨论】:

    标签: sas proc-report


    【解决方案1】:

    下次发布您尝试过的 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;
    

    推荐阅读:Sailing Over the ACROSS Hurdle in PROC REPORT. Cynthia L. Zender, SAS Institute Inc., Cary, NC

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-04-25
      • 2021-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-17
      • 1970-01-01
      相关资源
      最近更新 更多