<?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: Counting non-missing character variables. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Counting-non-missing-character-variables/m-p/48734#M10063</link>
    <description>Hi:&lt;BR /&gt;
  Here's my .02 -- when I see "count" and "values", I automatically think of PROC FREQ. PROC FREQ can create an output dataset and it can take:&lt;BR /&gt;
TABLES _CHARACTER_;&lt;BR /&gt;
or TABLES &amp;amp;wantchar;&lt;BR /&gt;
 &lt;BR /&gt;
in the syntax.&lt;BR /&gt;
&lt;BR /&gt;
You said you were trying to -use- a dataset to do the counting...I interpreted that as dataset going in, but ??? what's coming out ??? another dataset or a report??&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
    <pubDate>Fri, 29 Jan 2010 15:49:34 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2010-01-29T15:49:34Z</dc:date>
    <item>
      <title>Counting non-missing character variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-non-missing-character-variables/m-p/48729#M10058</link>
      <description>Hi All, &lt;BR /&gt;
&lt;BR /&gt;
I am trying to use a dataset to count the occurances of non missing values within a dynamic list of character variables. &lt;BR /&gt;
&lt;BR /&gt;
Is there a function that I can't find on help such as CMISS but that counts non missing instead? &lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance for any advice!</description>
      <pubDate>Fri, 29 Jan 2010 11:49:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-non-missing-character-variables/m-p/48729#M10058</guid>
      <dc:creator>GemmaR</dc:creator>
      <dc:date>2010-01-29T11:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Counting non-missing character variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-non-missing-character-variables/m-p/48730#M10059</link>
      <description>Perhaps if you make an array then use &lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
   notMissing = dim(array)-cmiss(of array&lt;LI&gt;);&lt;BR /&gt;
[/pre]&lt;/LI&gt;</description>
      <pubDate>Fri, 29 Jan 2010 13:19:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-non-missing-character-variables/m-p/48730#M10059</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-01-29T13:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Counting non-missing character variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-non-missing-character-variables/m-p/48731#M10060</link>
      <description>Thanks for the suggestion data_null, it just needs to be even more simple than an array or a do loop as they don't know those. We are using EG and I just didn't know if there was a function I had missed along the way.......</description>
      <pubDate>Fri, 29 Jan 2010 13:25:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-non-missing-character-variables/m-p/48731#M10060</guid>
      <dc:creator>GemmaR</dc:creator>
      <dc:date>2010-01-29T13:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Counting non-missing character variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-non-missing-character-variables/m-p/48732#M10061</link>
      <description>There is no DO looping involved. I don't know EG but this seems pretty simple to me.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data ...;&lt;BR /&gt;
   set ...;&lt;BR /&gt;
   array _c&lt;LI&gt; _character_;&lt;BR /&gt;
   notmissing = dim(_c) - cmiss(of _c&lt;/LI&gt;&lt;LI&gt;);&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
AFAIK you will need to define the array to determine the number of _character_ variables.&lt;/LI&gt;</description>
      <pubDate>Fri, 29 Jan 2010 13:42:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-non-missing-character-variables/m-p/48732#M10061</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-01-29T13:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Counting non-missing character variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-non-missing-character-variables/m-p/48733#M10062</link>
      <description>how dynamic is the list of character variables?&lt;BR /&gt;
Possibly could use the modifiers which provide more support for delimters.&lt;BR /&gt;
CATQ() and COUNTW(), as shown in this SASlog snippet :[pre]1625  %let dynamic_var_list =  c a b ;&lt;BR /&gt;
1626  data ;&lt;BR /&gt;
1627   a='1'; b='|'; c=' ' ;&lt;BR /&gt;
1628   d= catq( 'mdt','|', of a c b );&lt;BR /&gt;
1629   put d= ;&lt;BR /&gt;
1630   e= countw( d, '|', 'mq' ) ;&lt;BR /&gt;
1631   f= countw( d, '|', 'q' ) ;&lt;BR /&gt;
1632   put e= f=  ;&lt;BR /&gt;
1633   allasone= countW( catq( 'mdt','|', of &amp;amp;dynamic_var_list ), '|', 'q' ) ;&lt;BR /&gt;
1634   put (_all_)(=) ;&lt;BR /&gt;
1635  run;&lt;BR /&gt;
&lt;BR /&gt;
d=1||"|"&lt;BR /&gt;
e=3 f=2&lt;BR /&gt;
a=1 b=| c=  d=1||"|" e=3 f=2 allasone=2&lt;BR /&gt;
NOTE:</description>
      <pubDate>Fri, 29 Jan 2010 13:49:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-non-missing-character-variables/m-p/48733#M10062</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-01-29T13:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Counting non-missing character variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-non-missing-character-variables/m-p/48734#M10063</link>
      <description>Hi:&lt;BR /&gt;
  Here's my .02 -- when I see "count" and "values", I automatically think of PROC FREQ. PROC FREQ can create an output dataset and it can take:&lt;BR /&gt;
TABLES _CHARACTER_;&lt;BR /&gt;
or TABLES &amp;amp;wantchar;&lt;BR /&gt;
 &lt;BR /&gt;
in the syntax.&lt;BR /&gt;
&lt;BR /&gt;
You said you were trying to -use- a dataset to do the counting...I interpreted that as dataset going in, but ??? what's coming out ??? another dataset or a report??&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 29 Jan 2010 15:49:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-non-missing-character-variables/m-p/48734#M10063</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-01-29T15:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Counting non-missing character variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-non-missing-character-variables/m-p/48735#M10064</link>
      <description>Hello there, &lt;BR /&gt;
&lt;BR /&gt;
Thanks for all the advice, am going to go with do-loops and arrays to output and count the information that I've got.</description>
      <pubDate>Mon, 01 Feb 2010 13:50:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-non-missing-character-variables/m-p/48735#M10064</guid>
      <dc:creator>GemmaR</dc:creator>
      <dc:date>2010-02-01T13:50:48Z</dc:date>
    </item>
  </channel>
</rss>

