<?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 do i cross just few values of a variable using proc tabulate in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475437#M21239</link>
    <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;I am trying to cross a few variables but I want to cross just the specific values in those variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Eg. I&amp;nbsp;have a&amp;nbsp;variable&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Variable CO_Nike - Value 1 - ' Owners'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value 2 - 'Nonowner'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Now, I just want to cross the CO_Nike 'Owners'&amp;nbsp;with all my other variables. How can I do this?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the code I have till now , which gives me results for both owners and non-owners&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; all_uk_ts&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; V10101 &lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt; co_nike &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token datalines"&gt; &lt;SPAN class="token keyword"&gt;Datalines&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN class="token data string"&gt; 11 1 11 1 11 2 11 1 11 1 11 2 11 1 11 2 11 2 11 1 12 1 12 2 12 1 12 1 12 2 12 1 12 2 12 1 12 1 &lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;print&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;all_uk_ts&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;format&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;value&lt;/SPAN&gt; for_ownership &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'Owners'&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'Nonowners'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;value&lt;/SPAN&gt; for_country &lt;SPAN class="token number"&gt;11&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'UK'&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;12&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'GE'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;tabulate&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;all_uk_ts &lt;SPAN class="token procnames"&gt;format&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;10.0&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;format&lt;/SPAN&gt; co_nike for_ownership&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt; v10101 for_country&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token statement"&gt;class&lt;/SPAN&gt; co_nike v10101&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;tables&lt;/SPAN&gt; co_nike&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;v10101&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the output I am getting&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;SPAN class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below"&gt;&lt;IMG class="lia-media-image" src="https://communities.sas.com/t5/image/serverpage/image-id/21574i7DAF3EB4B64F5D6C/image-size/medium?v=1.0&amp;amp;px=400" border="0" alt="Current ouput.PNG" title="Current ouput.PNG" /&gt;&lt;I class="lia-fa lia-fa-search-plus lia-media-lightbox-trigger"&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;But I want just the owners row in my output.&lt;/STRONG&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have bolded, in your post, what the question presented here is.&amp;nbsp; The answer to which is:&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=all_uk_ts format=10.0;
  format co_nike for_ownership. v10101 for_country.; 
  where co_nike=1;
  class co_nike v10101;
  tables co_nike,v10101;
run;&lt;/PRE&gt;
&lt;P&gt;Which provides as output:&lt;/P&gt;
&lt;PRE&gt;                                          The SAS System         13:16 Wednesday, July 4, 2018   2

                          ----------------------------------------------
                          |                      |       V10101        |
                          |                      |---------------------|
                          |                      |    UK    |    GE    |
                          |                      |----------+----------|
                          |                      |    N     |    N     |
                          |----------------------+----------+----------|
                          |co_nike               |          |          |
                          |----------------------|          |          |
                          |Owners                |         6|         6|
                          ----------------------------------------------&lt;/PRE&gt;
&lt;P&gt;I cannot ascertain anything further I can provide without some explanation of what further is required?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jul 2018 13:22:03 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-07-04T13:22:03Z</dc:date>
    <item>
      <title>How do i cross just few values of a variable using proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475388#M21232</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to cross a few variables but I want to cross just the specific values in those variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Eg. I&amp;nbsp;have a&amp;nbsp;variable&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Variable CO_Nike - Value 1 - ' Owners'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value 2 - 'Nonowner'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I just want to cross the CO_Nike 'Owners'&amp;nbsp;with all my other variables. How can I do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the code I have till now , which gives me results for both owners and non-owners&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data all_uk_ts;
	input V10101 2. +1 co_nike 1.;
	Datalines; 11 1
11 1
11 2
11 1
11 1
11 2
11 1
11 2
11 2
11 1
12 1
12 2
12 1
12 1
12 2
12 1
12 2
12 1
12 1
;

run;

proc print data=all_uk_ts;
run;

proc format;
  value for_ownership 
    1='Owners'
    2='Nonowners';
  value for_country 
    11='UK'
    12='GE';					 
run;

proc tabulate data=all_uk_ts format=10.0;
  format co_nike for_ownership. v10101 for_country.; 
  class co_nike v10101;
  tables co_nike,v10101;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the output I am getting&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Current ouput.PNG" style="width: 153px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21574i7DAF3EB4B64F5D6C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Current ouput.PNG" alt="Current ouput.PNG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I want just the owners row in my output.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 10:51:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475388#M21232</guid>
      <dc:creator>Bedi</dc:creator>
      <dc:date>2018-07-04T10:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do i cross just few values of a variable using proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475392#M21233</link>
      <description>&lt;P&gt;Post test data in the form of a datastep.&amp;nbsp; Show what you want the output to look like.&amp;nbsp; At a guess add:&lt;/P&gt;
&lt;PRE&gt;data all_uk_ts;
  set all_uk_ts;
run;

proc format;
  value for_ownership 
    1='Owners'
    2='Nonowners';
  value for_country 
    11='UK';					 
run;

proc tabulate data=master.all_uk_ts format=10.0;
  format co_nike for_ownership. v10101 for_country.; &lt;BR /&gt;  where co_nike=1;
  class co_nike v10101;
  tables co_nike,v10101;
run;&lt;/PRE&gt;
&lt;P&gt;Note how I avoid using uppercase, use indents, finish blocks of code etc.&amp;nbsp; It is important to make the code as readable as possible.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 10:21:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475392#M21233</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-07-04T10:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do i cross just few values of a variable using proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475400#M21234</link>
      <description>&lt;P&gt;Hey, Thanks for your comment, I have updated my post, please have look.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 10:52:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475400#M21234</guid>
      <dc:creator>Bedi</dc:creator>
      <dc:date>2018-07-04T10:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do i cross just few values of a variable using proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475423#M21235</link>
      <description>&lt;P&gt;And I assume you tried it with the aforementioned where clause?&lt;/P&gt;
&lt;PRE&gt;  where co_nike=1;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Jul 2018 12:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475423#M21235</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-07-04T12:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do i cross just few values of a variable using proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475426#M21236</link>
      <description>&lt;P&gt;Yes, however that solution will not be of much use as I want to implement this with multiple variables&amp;nbsp;with select values in the row.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 12:39:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475426#M21236</guid>
      <dc:creator>Bedi</dc:creator>
      <dc:date>2018-07-04T12:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do i cross just few values of a variable using proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475427#M21237</link>
      <description>&lt;P&gt;Please post an example of your problem - the whole problem.&amp;nbsp; What does this mean for instance - "&lt;SPAN&gt;I want to implement this with multiple variables&amp;nbsp;with select values"?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;We can only answer the question as it is presented here.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 12:44:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475427#M21237</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-07-04T12:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do i cross just few values of a variable using proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475433#M21238</link>
      <description>&lt;P&gt;This is the whole problem which I have explained in detail in my post.&lt;/P&gt;&lt;P&gt;I want to understand how we can display the cross tab of certain values in the&amp;nbsp;variables by using&amp;nbsp;Proc tabulate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 13:09:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475433#M21238</guid>
      <dc:creator>Bedi</dc:creator>
      <dc:date>2018-07-04T13:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do i cross just few values of a variable using proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475437#M21239</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;I am trying to cross a few variables but I want to cross just the specific values in those variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Eg. I&amp;nbsp;have a&amp;nbsp;variable&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Variable CO_Nike - Value 1 - ' Owners'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value 2 - 'Nonowner'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Now, I just want to cross the CO_Nike 'Owners'&amp;nbsp;with all my other variables. How can I do this?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the code I have till now , which gives me results for both owners and non-owners&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; all_uk_ts&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; V10101 &lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt; co_nike &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token datalines"&gt; &lt;SPAN class="token keyword"&gt;Datalines&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN class="token data string"&gt; 11 1 11 1 11 2 11 1 11 1 11 2 11 1 11 2 11 2 11 1 12 1 12 2 12 1 12 1 12 2 12 1 12 2 12 1 12 1 &lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;print&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;all_uk_ts&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;format&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;value&lt;/SPAN&gt; for_ownership &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'Owners'&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'Nonowners'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;value&lt;/SPAN&gt; for_country &lt;SPAN class="token number"&gt;11&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'UK'&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;12&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'GE'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;tabulate&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;all_uk_ts &lt;SPAN class="token procnames"&gt;format&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;10.0&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;format&lt;/SPAN&gt; co_nike for_ownership&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt; v10101 for_country&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token statement"&gt;class&lt;/SPAN&gt; co_nike v10101&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;tables&lt;/SPAN&gt; co_nike&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;v10101&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the output I am getting&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;SPAN class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below"&gt;&lt;IMG class="lia-media-image" src="https://communities.sas.com/t5/image/serverpage/image-id/21574i7DAF3EB4B64F5D6C/image-size/medium?v=1.0&amp;amp;px=400" border="0" alt="Current ouput.PNG" title="Current ouput.PNG" /&gt;&lt;I class="lia-fa lia-fa-search-plus lia-media-lightbox-trigger"&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;But I want just the owners row in my output.&lt;/STRONG&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have bolded, in your post, what the question presented here is.&amp;nbsp; The answer to which is:&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=all_uk_ts format=10.0;
  format co_nike for_ownership. v10101 for_country.; 
  where co_nike=1;
  class co_nike v10101;
  tables co_nike,v10101;
run;&lt;/PRE&gt;
&lt;P&gt;Which provides as output:&lt;/P&gt;
&lt;PRE&gt;                                          The SAS System         13:16 Wednesday, July 4, 2018   2

                          ----------------------------------------------
                          |                      |       V10101        |
                          |                      |---------------------|
                          |                      |    UK    |    GE    |
                          |                      |----------+----------|
                          |                      |    N     |    N     |
                          |----------------------+----------+----------|
                          |co_nike               |          |          |
                          |----------------------|          |          |
                          |Owners                |         6|         6|
                          ----------------------------------------------&lt;/PRE&gt;
&lt;P&gt;I cannot ascertain anything further I can provide without some explanation of what further is required?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 13:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475437#M21239</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-07-04T13:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do i cross just few values of a variable using proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475470#M21240</link>
      <description>&lt;P&gt;As a general approach ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using the PROC TABULATE as is, create an output data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Subset the output data set to contain just the data you want displayed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Feed the subset into a second PROC TABULATE (probably requesting the SUM statistic).&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 16:58:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475470#M21240</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-04T16:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do i cross just few values of a variable using proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475528#M21241</link>
      <description>&lt;P&gt;I thought I did my best to explain my problem but not enough for you. Here , I will give it another shot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my full code with all the brands like Nike, Adidas etc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data all_uk_ts;
	input V10101 2. +1 co_nike 1. +1 co_Adidas 1. +1 co_Reebok 1. +1 co_Bat 1.;
	Datalines; 11 1 1 2 2
11 1 2 1 1
11 2 2 1 2
11 1 2 1 1
11 1 2 2 1
11 2 1 2 2
11 1 1 1 1
11 2 2 2 2
11 2 2 2 1
11 1 1 1 1
12 1 2 1 1
12 2 2 1 2
12 1 1 1 1
12 1 1 1 1
12 2 1 2 2
12 1 1 1 1
12 2 2 2 2
12 1 1 1 1
12 1 1 1 1
;

run;

proc print data=all_uk_ts;
run;

proc format;
  value for_ownership 
    1='Owners'
    2='Nonowners';
  value for_country 
    11='UK'
    12='GE';					 
run;

proc tabulate data=all_uk_ts format=10.0;
  format co_nike -- co_Bat for_ownership. v10101 for_country.; 
  class co_nike co_Adidas co_Reebok co_Bat v10101;
  tables co_nike co_Adidas co_Reebok co_Bat,v10101;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Above code gives below output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Current ouput.PNG" style="width: 165px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21581iBB948CDD0E6B974E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Current ouput.PNG" alt="Current ouput.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However , the output that I am looking for is the one &lt;STRONG&gt;without&lt;/STRONG&gt; 'Nonowners' rows in the above output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this explains.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 06:06:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475528#M21241</guid>
      <dc:creator>Bedi</dc:creator>
      <dc:date>2018-07-05T06:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do i cross just few values of a variable using proc tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475544#M21242</link>
      <description>&lt;P&gt;So something like this (note your datalines is incorrect for the first one - it should be a on separate line, as such your numbers are 1 short).&amp;nbsp; What I do is blank the data&amp;nbsp;I don't want to include, as tabulate does not use that by default:&lt;/P&gt;
&lt;PRE&gt;data all_uk_ts;
  input V10101 2. +1 co_nike 1. +1 co_Adidas 1. +1 co_Reebok 1. +1 co_Bat 1.;
  array c co_:;
  do over c;
    if c=2 then c=.;
  end;
datalines; 
11 1 1 2 2
11 1 2 1 1
11 2 2 1 2
11 1 2 1 1
11 1 2 2 1
11 2 1 2 2
11 1 1 1 1
11 2 2 2 2
11 2 2 2 1
11 1 1 1 1
12 1 2 1 1
12 2 2 1 2
12 1 1 1 1
12 1 1 1 1
12 2 1 2 2
12 1 1 1 1
12 2 2 2 2
12 1 1 1 1
12 1 1 1 1
;

run;

proc format;
  value for_ownership 
    1='Owners'
    2='Nonowners';
  value for_country 
    11='UK'
    12='GE';                
run;

proc tabulate data=all_uk_ts format=10.0;
  format co_: for_ownership. v10101 for_country.; 
  class v10101;
  var co_:;
  tables co_: * (n=''),v10101;  /* You could put the word owners in the label there */
run;&lt;/PRE&gt;
&lt;P&gt;Its a bit of a faff,&amp;nbsp;which is why I really don't like the tabulate procedure.&amp;nbsp; If I was doing this table I would datastep my results, just a retained count, then transpose that up by country if needed.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 08:30:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-do-i-cross-just-few-values-of-a-variable-using-proc-tabulate/m-p/475544#M21242</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-07-05T08:30:46Z</dc:date>
    </item>
  </channel>
</rss>

