<?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: Fundamental Missing with array in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Fundamental-Missing-with-array/m-p/106593#M291757</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Easy cmiss counts missing values and you can use the name range list.&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; cmiss;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; sashelp.heart;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; cmiss = cmiss(of deathcause--cholesterol);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Aug 2013 17:20:26 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2013-08-09T17:20:26Z</dc:date>
    <item>
      <title>Fundamental Missing with array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fundamental-Missing-with-array/m-p/106589#M291753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone. Is it possible to set up an array on multi type columns and use a missing function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I am trying to do is flag any row in which ANY variables are null between Variables starting in Column D and ending in Column Y (out of 50+ columns). However there is a wide mix of data between these columns (both character and numeric) so I was wondering if this could be done with a fancy trick using an array statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could always write multiple where statments, such as "where missing(VARH)=0 OR missing(VARI)=o.......", but it seems like there should be a much easier way to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2013 16:12:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fundamental-Missing-with-array/m-p/106589#M291753</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-08-09T16:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Fundamental Missing with array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fundamental-Missing-with-array/m-p/106590#M291754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF you wanted all variable instead of arrays use the NMISS and CMISS functions with the speciall variable lists _NUMERIC_ and _CHARACTER_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag = nmiss (of _numeric_) or cmiss (of _character_);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but since you need specific variable you would need to put lists of the variable names in place of _numeric_ or character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select name into : clist separated by ','&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; from dictionary.columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where libname='WORK' and memname = 'DATASETNAME' and TYPE='char' and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; varnum between 1 and 50;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select name into : nlist separated by ','&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; from dictionary.columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where libname='WORK' and memname = 'DATASETNAME' and TYPE='num' and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; varnum between 1 and 50;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;NOTE: the library and dataset names above must be in upper case when compared with the dictionary value. Replace with your data set libarary and dataset name. You will need to determine the minimum and maximum values for VARNUM by counting across your columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in your data step:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag = nmiss (&amp;amp;nlist) or cmiss (&amp;amp;clist);&lt;/P&gt;&lt;P&gt;Flag should have a value of 1 for any row with a missing value, 0 otherwise.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2013 16:44:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fundamental-Missing-with-array/m-p/106590#M291754</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-08-09T16:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Fundamental Missing with array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fundamental-Missing-with-array/m-p/106591#M291755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't quite have an array for both char and num. If your table structure is fairly static, you can use one-dimensional arrays using _character_ and _numeric_ to load all variables into an array at each step and use array to loop. However, to do this, you need to know the index of columnD in the subset of ordered character or numeric variables. If your table structure is fairly static, it is probably simpler to hard code it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, otherwise, you can use a if _n_=1 then do; end; block to read into sashelp.vcolumn to figure out how how many total columns are numeric (resp char), what's the relative index of the first columnX that is num (resp char) and index of last one, store those in a 2*2 array _temporary_ (so that you have it availible through each further iteration of the data step without recalculating) and use this array of indexes to control your loops over the _character_ and _numeric_ array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The painful part is coding the do;end; block to generate the indexes, hence why I suggest that you hard code it if your table structure is static.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vince&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2013 17:04:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fundamental-Missing-with-array/m-p/106591#M291755</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2013-08-09T17:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Fundamental Missing with array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fundamental-Missing-with-array/m-p/106592#M291756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect this is one of the reasons why SAS came up with Hash().&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2013 17:07:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fundamental-Missing-with-array/m-p/106592#M291756</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-08-09T17:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Fundamental Missing with array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fundamental-Missing-with-array/m-p/106593#M291757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Easy cmiss counts missing values and you can use the name range list.&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; cmiss;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; sashelp.heart;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; cmiss = cmiss(of deathcause--cholesterol);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2013 17:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fundamental-Missing-with-array/m-p/106593#M291757</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-08-09T17:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Fundamental Missing with array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fundamental-Missing-with-array/m-p/106594#M291758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting, I didn't know cmiss worked on both character and numeric variables (even though it's actually written in sas documentation).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2013 17:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fundamental-Missing-with-array/m-p/106594#M291758</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2013-08-09T17:38:44Z</dc:date>
    </item>
  </channel>
</rss>

