首页 > 解决方案 > 如何转置 sas proc 报告输出

问题描述

我已经创建了一份报告(proc 报告),并且(在去谷歌大学之后)转置我的数据的所有努力都出现了严重错误。

proc report data=dataset1;
where cluster_id=1;
column ORGANISATION_CODE 
   ORGANISATION_NAME 
   ORG_TYPE
   org_type_name 
   CLUSTER_ID 
   CLUSTER_NAME 
   CLUSTER_TYPE 
   CountOFD
   CountOFC;
  define ORGANISATION_CODE / display 'Organisation Code' CENTER
  style(column)={width=1.5in} ;
     define ORGANISATION_NAME  / display 'Organisation Name' lEFT
    style(column)={width=1.5in} ;
     define org_type_name  /display 'Organisation Type' CENTER
style(column)={width=1.5in} ;
     define  org_type_name /display 'Organisation Type Name' CENTER
style(column)={width=1.5in} ;
     define CLUSTER_TYPE / display 'Cluster Type' CENTER
style(column)={width=1.5in} ;
      define CLUSTER_NAME / display 'Cluster Name' CENTER
style(column)={width=1.5in} ;
       define CLUSTER_ID / display 'Cluster ID' CENTER
style(column)={width=1.5in} ;
        define CountOFD / display 'CountOFD' CENTER
style(column)={width=1.5in} ;
        define CountOFC / display 'CountOFD' CENTER
style(column)={width=1.5in} ;       
run;
ods html close;

标签: sas

解决方案


我同意乔的观点,我需要更多信息。

您是否尝试define语句中的 cross选项,以及column语句中的堆叠列?请参阅http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#n1pl56sdqo09cyn1fifuhcz8dl2f.htm

如果这不起作用,请参阅 PROC TRANSPOSE。


推荐阅读