<?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: Count total columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Count-total-columns/m-p/330684#M74236</link>
    <description>It's counting now I had 0 in the do i=1&lt;BR /&gt;&lt;BR /&gt;Here is the output&lt;BR /&gt;List_of_vars. To. Search. Count. I&lt;BR /&gt;0. 5&lt;BR /&gt;0. 5&lt;BR /&gt;0. 5&lt;BR /&gt;&lt;BR /&gt;I'm duplicating your data step&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
    <pubDate>Wed, 08 Feb 2017 00:51:10 GMT</pubDate>
    <dc:creator>Gil_</dc:creator>
    <dc:date>2017-02-08T00:51:10Z</dc:date>
    <item>
      <title>Count total columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-total-columns/m-p/330631#M74217</link>
      <description>Hi I have a table and need to know total count of columns with word Atmbar&lt;BR /&gt;&lt;BR /&gt;Atm1. Atm2. . Atm3. Atm4. Total&lt;BR /&gt;Bagbar1. Atmbar1 bagbar2. Atmbar2. 2&lt;BR /&gt;&lt;BR /&gt;Bagbar1. Atmbar1 1&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Feb 2017 21:59:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-total-columns/m-p/330631#M74217</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-02-07T21:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Count total columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-total-columns/m-p/330635#M74218</link>
      <description>&lt;P&gt;Will each variable only have one value or word?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Either way, this is a simple array loop with a counter:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	array vars(*) list_of_vars to search here;
	count=0;

	do i=1 to dim(vars);
		if find(vars(i), 'ATMBAR', 'i')&amp;gt;0 then
			count+1;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Feb 2017 22:05:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-total-columns/m-p/330635#M74218</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-07T22:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Count total columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-total-columns/m-p/330672#M74229</link>
      <description>Thanks Reeza for responding&lt;BR /&gt;&lt;BR /&gt;I'm getting an error on array subscript out of range at line 107&lt;BR /&gt;&lt;BR /&gt;If find (vars (i), 'ATMBAR' 'i')&amp;gt; then count+1;&lt;BR /&gt;&lt;BR /&gt;My data looks like this not sure if it affects output&lt;BR /&gt;&lt;BR /&gt;Atm1. Atm2.&lt;BR /&gt;Bagbarcode:"RS505972" Atmbarcode:"ny1925220204"&lt;BR /&gt;ATM. ATM4&lt;BR /&gt;Bagbarcode: "RS807978" Atmbarcode:"ca12352205"&lt;BR /&gt;Total = 2&lt;BR /&gt;&lt;BR /&gt;Thanks again</description>
      <pubDate>Wed, 08 Feb 2017 00:03:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-total-columns/m-p/330672#M74229</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-02-08T00:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Count total columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-total-columns/m-p/330674#M74231</link>
      <description>&lt;P&gt;Post the full code you used and your log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure that you've listed all variables properly.&lt;/P&gt;
&lt;P&gt;I don't understand your data structure at all. Please include a data step code to reproduce your data if you want further assistance, otherwise you'll get generic responses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 00:09:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-total-columns/m-p/330674#M74231</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-08T00:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Count total columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-total-columns/m-p/330684#M74236</link>
      <description>It's counting now I had 0 in the do i=1&lt;BR /&gt;&lt;BR /&gt;Here is the output&lt;BR /&gt;List_of_vars. To. Search. Count. I&lt;BR /&gt;0. 5&lt;BR /&gt;0. 5&lt;BR /&gt;0. 5&lt;BR /&gt;&lt;BR /&gt;I'm duplicating your data step&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Feb 2017 00:51:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-total-columns/m-p/330684#M74236</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-02-08T00:51:10Z</dc:date>
    </item>
  </channel>
</rss>

