<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can hide one of across column. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-can-hide-one-of-across-column/m-p/7884#M228</link>
    <description>Hi:&lt;BR /&gt;
  It would be helpful to show ALL of the code that you're using and a small sample of your data. Are your variables in the INPUT dataset named _C4_ and _C5_??? Or, are you trying to use the NOPRINT option on the absolute column names that PROC REPORT creates internally??? Generally speaking, you do not use PROC REPORT's absolute column names in a DEFINE statement.&lt;BR /&gt;
 &lt;BR /&gt;
  If, for example, your ACROSS variable was REGION and you had this column statement:&lt;BR /&gt;
[pre]&lt;BR /&gt;
COLUMN JOBCODE REGION,N;&lt;BR /&gt;
DEFINE JOBCODE / GROUP;&lt;BR /&gt;
DEFINE REGION / ACROSS;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
  &lt;BR /&gt;
If you had 4 regions (A, B, C, D), then the internal absolute column names (as calculated by PROC REPORT would be:&lt;BR /&gt;
JOBCODE is column 1 on the report (not an ACROSS item)&lt;BR /&gt;
count column for REGION A = _c2_&lt;BR /&gt;
count column for REGION B = _c3_&lt;BR /&gt;
count column for REGION C = _c4_&lt;BR /&gt;
count column for REGION D = _c5_&lt;BR /&gt;
 &lt;BR /&gt;
On the other hand, if you had this column statement with 2 variables nested under REGION, it would be different:&lt;BR /&gt;
[pre]&lt;BR /&gt;
COLUMN JOBCODE REGION,(N SAL);&lt;BR /&gt;
DEFINE JOBCODE / GROUP;&lt;BR /&gt;
DEFINE REGION/ ACROSS;&lt;BR /&gt;
DEFINE N / 'COUNT';&lt;BR /&gt;
DEFINE SAL / Mean 'AVG SAL';&lt;BR /&gt;
[/pre]&lt;BR /&gt;
  &lt;BR /&gt;
Then the absolute columns would be assigned differently:&lt;BR /&gt;
JOBCODE would still be the first column.&lt;BR /&gt;
_C2_ would be COUNT for REGION A&lt;BR /&gt;
_C3_ would be SAL for REGION A&lt;BR /&gt;
_C4_ would be COUNT for REGION B&lt;BR /&gt;
_C5_ would be SAL for REGION B&lt;BR /&gt;
_C6_ would be COUNT for REGION C&lt;BR /&gt;
_C7_ would be SAL for REGION C&lt;BR /&gt;
_C8_ would be COUNT for REGION D&lt;BR /&gt;
_C9_ would be SAL for REGION D&lt;BR /&gt;
&lt;BR /&gt;
And, if you were COMPUTING an item that was under an ACROSS variable, you would potentially have more absolute column names. But let's say, in the above example that you want to USE the N or count for some reason, but hide it on the report. Then in your DEFINE statement you would NOT use the absolute column names to hide the column, you would do this:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
COLUMN JOBCODE REGION,(N SAL);&lt;BR /&gt;
DEFINE JOBCODE / GROUP;&lt;BR /&gt;
DEFINE REGION/ ACROSS;&lt;BR /&gt;
DEFINE N / 'COUNT' NOPRINT;&lt;BR /&gt;
DEFINE SAL / Mean 'AVG SAL';&lt;BR /&gt;
[/pre]&lt;BR /&gt;
  &lt;BR /&gt;
  I'm not sure what you mean by "take missing values"??? Are you computing a value that comes out to missing or do you have an ACROSS report item with all missing values??? For example, with the above code snippet, just knowing the report item names isn't enough, it is also necessary to know whether there are observations with missing values for JOBCODE, missing values for REGION and/or missing values for the variables that are nested under REGION -- In order to figure the best approach.&lt;BR /&gt;
&lt;BR /&gt;
This would be an instance where seeing a small sample or better description of your data would be useful. You might want to consider opening a track with Tech Support, as they can look at your actual data and ALL your code and help you arrive at a solution.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
    <pubDate>Tue, 27 Oct 2009 15:35:59 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2009-10-27T15:35:59Z</dc:date>
    <item>
      <title>How can hide one of across column.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-hide-one-of-across-column/m-p/7883#M227</link>
      <description>I am working on across function. In which if I take missing value it creates an unwanted column with none value . I don't want to display it in output.&lt;BR /&gt;
I tried with. &lt;BR /&gt;
DEFINE _C4_/ FORMAT=6.0 NOPRINT;&lt;BR /&gt;
DEFINE _C5_/FORMAT=6.0 NOPRINT;&lt;BR /&gt;
&lt;BR /&gt;
but it is not working .&lt;BR /&gt;
Please explain me how can I get the desire output.</description>
      <pubDate>Tue, 27 Oct 2009 08:24:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-hide-one-of-across-column/m-p/7883#M227</guid>
      <dc:creator>vimal</dc:creator>
      <dc:date>2009-10-27T08:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can hide one of across column.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-hide-one-of-across-column/m-p/7884#M228</link>
      <description>Hi:&lt;BR /&gt;
  It would be helpful to show ALL of the code that you're using and a small sample of your data. Are your variables in the INPUT dataset named _C4_ and _C5_??? Or, are you trying to use the NOPRINT option on the absolute column names that PROC REPORT creates internally??? Generally speaking, you do not use PROC REPORT's absolute column names in a DEFINE statement.&lt;BR /&gt;
 &lt;BR /&gt;
  If, for example, your ACROSS variable was REGION and you had this column statement:&lt;BR /&gt;
[pre]&lt;BR /&gt;
COLUMN JOBCODE REGION,N;&lt;BR /&gt;
DEFINE JOBCODE / GROUP;&lt;BR /&gt;
DEFINE REGION / ACROSS;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
  &lt;BR /&gt;
If you had 4 regions (A, B, C, D), then the internal absolute column names (as calculated by PROC REPORT would be:&lt;BR /&gt;
JOBCODE is column 1 on the report (not an ACROSS item)&lt;BR /&gt;
count column for REGION A = _c2_&lt;BR /&gt;
count column for REGION B = _c3_&lt;BR /&gt;
count column for REGION C = _c4_&lt;BR /&gt;
count column for REGION D = _c5_&lt;BR /&gt;
 &lt;BR /&gt;
On the other hand, if you had this column statement with 2 variables nested under REGION, it would be different:&lt;BR /&gt;
[pre]&lt;BR /&gt;
COLUMN JOBCODE REGION,(N SAL);&lt;BR /&gt;
DEFINE JOBCODE / GROUP;&lt;BR /&gt;
DEFINE REGION/ ACROSS;&lt;BR /&gt;
DEFINE N / 'COUNT';&lt;BR /&gt;
DEFINE SAL / Mean 'AVG SAL';&lt;BR /&gt;
[/pre]&lt;BR /&gt;
  &lt;BR /&gt;
Then the absolute columns would be assigned differently:&lt;BR /&gt;
JOBCODE would still be the first column.&lt;BR /&gt;
_C2_ would be COUNT for REGION A&lt;BR /&gt;
_C3_ would be SAL for REGION A&lt;BR /&gt;
_C4_ would be COUNT for REGION B&lt;BR /&gt;
_C5_ would be SAL for REGION B&lt;BR /&gt;
_C6_ would be COUNT for REGION C&lt;BR /&gt;
_C7_ would be SAL for REGION C&lt;BR /&gt;
_C8_ would be COUNT for REGION D&lt;BR /&gt;
_C9_ would be SAL for REGION D&lt;BR /&gt;
&lt;BR /&gt;
And, if you were COMPUTING an item that was under an ACROSS variable, you would potentially have more absolute column names. But let's say, in the above example that you want to USE the N or count for some reason, but hide it on the report. Then in your DEFINE statement you would NOT use the absolute column names to hide the column, you would do this:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
COLUMN JOBCODE REGION,(N SAL);&lt;BR /&gt;
DEFINE JOBCODE / GROUP;&lt;BR /&gt;
DEFINE REGION/ ACROSS;&lt;BR /&gt;
DEFINE N / 'COUNT' NOPRINT;&lt;BR /&gt;
DEFINE SAL / Mean 'AVG SAL';&lt;BR /&gt;
[/pre]&lt;BR /&gt;
  &lt;BR /&gt;
  I'm not sure what you mean by "take missing values"??? Are you computing a value that comes out to missing or do you have an ACROSS report item with all missing values??? For example, with the above code snippet, just knowing the report item names isn't enough, it is also necessary to know whether there are observations with missing values for JOBCODE, missing values for REGION and/or missing values for the variables that are nested under REGION -- In order to figure the best approach.&lt;BR /&gt;
&lt;BR /&gt;
This would be an instance where seeing a small sample or better description of your data would be useful. You might want to consider opening a track with Tech Support, as they can look at your actual data and ALL your code and help you arrive at a solution.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 27 Oct 2009 15:35:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-hide-one-of-across-column/m-p/7884#M228</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-10-27T15:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can hide one of across column.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-hide-one-of-across-column/m-p/7885#M229</link>
      <description>Dear,&lt;BR /&gt;
Thanks for the reply. This is the small example for what i am looking for.&lt;BR /&gt;
data test;&lt;BR /&gt;
input Name $15. Type $15. Number 2.;&lt;BR /&gt;
datalines;&lt;BR /&gt;
NUNGAMBAKKAM                  .&lt;BR /&gt;
PADIANALLUR    All            20&lt;BR /&gt;
RHROAD         Non-Privilege  30&lt;BR /&gt;
SELAIYUR                      .&lt;BR /&gt;
PORUR          Privilege      20&lt;BR /&gt;
SANTHOME       All            50&lt;BR /&gt;
RHROAD         Non-Privilege  60&lt;BR /&gt;
CHENNA         Privilege      25&lt;BR /&gt;
&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc report data=test missing;&lt;BR /&gt;
column name Type,Number;&lt;BR /&gt;
define Name/group;&lt;BR /&gt;
define Type/across;&lt;BR /&gt;
define number/sum;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Here, I do not want to display a column i.e with name 'Number' which do not contain any value along that I don't want to loose the Name which don't have  any value&lt;BR /&gt;
i.e.  'NUNGAMBAKKAM ' and 'SELAIYUR'.&lt;BR /&gt;
now tall me what I have to do.</description>
      <pubDate>Wed, 28 Oct 2009 05:22:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-hide-one-of-across-column/m-p/7885#M229</guid>
      <dc:creator>vimal</dc:creator>
      <dc:date>2009-10-28T05:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can hide one of across column.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-hide-one-of-across-column/m-p/7886#M230</link>
      <description>[pre]&lt;BR /&gt;
proc report nowd list data=test missing;&lt;BR /&gt;
   column name Type,N;&lt;BR /&gt;
   define Name/group;&lt;BR /&gt;
   define Type/across 'Type' '--';&lt;BR /&gt;
   define n / 'Number';&lt;BR /&gt;
   freq number;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Wed, 28 Oct 2009 13:21:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-hide-one-of-across-column/m-p/7886#M230</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2009-10-28T13:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can hide one of across column.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-hide-one-of-across-column/m-p/7887#M231</link>
      <description>Hi:&lt;BR /&gt;
  I do not believe that the FREQ statement or NOPRINT will work for this situation. If I understand the original post correctly, this is the current output:&lt;BR /&gt;
[pre]&lt;BR /&gt;
******** first output described ??? ****************************&lt;BR /&gt;
                                               Non&lt;BR /&gt;
                                    All  Privilege  Privilege&lt;BR /&gt;
  Name                Number     Number     Number     Number&lt;BR /&gt;
  CHENNA                   .          .          .         25&lt;BR /&gt;
  NUNGAMBAKKAM             .          .          .          .&lt;BR /&gt;
  PADIANALLUR              .         20          .          .&lt;BR /&gt;
  PORUR                    .          .          .         20&lt;BR /&gt;
  RHROAD                   .          .         90          .&lt;BR /&gt;
  SANTHOME                 .         50          .          .&lt;BR /&gt;
  SELAIYUR                 .          .          .          .&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                                                                   &lt;BR /&gt;
I think it is the NUMBER column of all missing that is not desired on the report.&lt;BR /&gt;
       &lt;BR /&gt;
Without the MISSING option or with MISSING option and N and the FREQ statement, the results would be this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
Code:&lt;BR /&gt;
proc report data=test missing nowd nocenter&lt;BR /&gt;
     split='-' ;&lt;BR /&gt;
column name Type,N ;&lt;BR /&gt;
define Name/group ;&lt;BR /&gt;
define Type/across width=10;&lt;BR /&gt;
freq number;&lt;BR /&gt;
run;&lt;BR /&gt;
          &lt;BR /&gt;
proc report data=test nowd nocenter&lt;BR /&gt;
     split='-' out=work.repout;&lt;BR /&gt;
column name Type,Number;&lt;BR /&gt;
define Name/group ;&lt;BR /&gt;
define Type/across width=10;&lt;BR /&gt;
define number/sum 'Number';&lt;BR /&gt;
run;&lt;BR /&gt;
          &lt;BR /&gt;
************** RESULTS ***********************&lt;BR /&gt;
                                type&lt;BR /&gt;
                                    Non&lt;BR /&gt;
                         All  Privilege  Privilege&lt;BR /&gt;
  Name                     N          N          N&lt;BR /&gt;
  CHENNA                   .          .         25&lt;BR /&gt;
  PADIANALLUR             20          .          .&lt;BR /&gt;
  PORUR                    .          .         20&lt;BR /&gt;
  RHROAD                   .         90          .&lt;BR /&gt;
  SANTHOME                50          .          .&lt;BR /&gt;
                                                &lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                                                                    &lt;BR /&gt;
The only difference between the 2 outputs is whether you see N or Number in the header underneath TYPE. Neither of these methods puts the names for NUNGAMBAKKAM and SELAIYUR  on the report. In order to get NUNGAMBAKKAM and SELAIYUR as rows on the report, you have to turn on the MISSING option. And, the side effect of the MISSING option is that while you get the names you want, the NUMBER column is NOT as you want -- but MISSING forces REPORT to display a blank value for TYPE (as shown in the first undesired report shown above at the very top)                &lt;BR /&gt;
                                                  &lt;BR /&gt;
If I understand correctly THIS (below) is the desired report output?? With the list of names as shown on the first output snapshot, but WITHOUT the missing column when TYPE=' '???&lt;BR /&gt;
[pre]&lt;BR /&gt;
                                        Non&lt;BR /&gt;
                             All  Privilege  Privilege&lt;BR /&gt;
  Name                    Number     Number     Number&lt;BR /&gt;
  CHENNA                       .          .         25&lt;BR /&gt;
  NUNGAMBAKKAM                 .          .          .&lt;BR /&gt;
  PADIANALLUR                 20          .          .&lt;BR /&gt;
  PORUR                        .          .         20&lt;BR /&gt;
  RHROAD                       .         90          .&lt;BR /&gt;
  SANTHOME                    50          .          .&lt;BR /&gt;
  SELAIYUR                     .          .          .&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                                                &lt;BR /&gt;
Two possible workarounds are &lt;BR /&gt;
1) make two passes through the output -- In the first pass, create one summary dataset and then run PROC REPORT on the summarized dataset or&lt;BR /&gt;
2) use PROC REPORT, COMPLETEROWS and PRELOADFMT to provide the list of names that you want to see on the report. This approach could be cumbersome if the list of names is long.&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 28 Oct 2009 22:36:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-hide-one-of-across-column/m-p/7887#M231</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-10-28T22:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can hide one of across column.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-hide-one-of-across-column/m-p/7888#M232</link>
      <description>I see now,  the OP wants to keep the rows with all zeros(missing) and get rid of any columns with all zeros.  As you say using PRELOADFMT is one way to achieve this result.  Even it the format would have many levels it is easy to create from the original data.&lt;BR /&gt;
&lt;BR /&gt;
I believe this produces the desired result.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data test;&lt;BR /&gt;
   infile cards missover;&lt;BR /&gt;
   input Name :$15. Type :$15. Number 2.;&lt;BR /&gt;
   datalines;&lt;BR /&gt;
NUNGAMBAKKAM . &lt;BR /&gt;
PADIANALLUR All 20&lt;BR /&gt;
RHROAD Non-Privilege 30&lt;BR /&gt;
SELAIYUR .&lt;BR /&gt;
PORUR Privilege 20&lt;BR /&gt;
SANTHOME All 50&lt;BR /&gt;
RHROAD Non-Privilege 60&lt;BR /&gt;
CHENNA Privilege 25&lt;BR /&gt;
;;;;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc sort data=test(keep=name) nodupkey out=names;&lt;BR /&gt;
   by name;&lt;BR /&gt;
   run;&lt;BR /&gt;
data names;&lt;BR /&gt;
   retain fmtname 'name' type 'C';&lt;BR /&gt;
   set names;&lt;BR /&gt;
   start = name;&lt;BR /&gt;
   label = name;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc format cntlin=names;&lt;BR /&gt;
   select $name;&lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
proc report nowd list data=test completerows;&lt;BR /&gt;
   column name Type, Number;   &lt;BR /&gt;
   define Name / group format=$name. preloadfmt;   &lt;BR /&gt;
   define Type / across 'Type' '--';   &lt;BR /&gt;
   define number / sum 'Number';   &lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 29 Oct 2009 15:07:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-hide-one-of-across-column/m-p/7888#M232</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2009-10-29T15:07:15Z</dc:date>
    </item>
  </channel>
</rss>

