<?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: Setting blank cells to 0 after merge in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Setting-blank-cells-to-0-after-merge/m-p/168849#M43671</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you simply modify after merging?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data Combined;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Modify Combined;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Array N _NUMERIC_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Do over N;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Missing (N) Then N=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; End;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Aug 2014 17:18:38 GMT</pubDate>
    <dc:creator>user24feb</dc:creator>
    <dc:date>2014-08-20T17:18:38Z</dc:date>
    <item>
      <title>Setting blank cells to 0 after merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Setting-blank-cells-to-0-after-merge/m-p/168844#M43666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm mergeing on claims information to a larger file called exposure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data combined;&lt;/P&gt;&lt;P&gt;merge exposure(in=a) claims;&lt;/P&gt;&lt;P&gt;by key;&lt;/P&gt;&lt;P&gt;if a;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are about 20 numeric claims fields attaching on and some character fields. Where there are no claims info to attach on to a given row in the exposure, the claims field is blank, I want this to be 0 for numeric fields and N/A for character fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to do this rather than going through every field like if field1 = . then field1 = 0....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 14:31:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Setting-blank-cells-to-0-after-merge/m-p/168844#M43666</guid>
      <dc:creator>brophymj</dc:creator>
      <dc:date>2014-08-20T14:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Setting blank cells to 0 after merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Setting-blank-cells-to-0-after-merge/m-p/168845#M43667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One approach is arrays. Without variable names/types I can't be too specific.&lt;/P&gt;&lt;P&gt;In the datastep code add something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;array claims &amp;lt;list the names of the numeric claims fields here&amp;gt;;&lt;/P&gt;&lt;P&gt;if &amp;lt;condition to determine no claims info&amp;gt; then do _I_=1 to dim(claims); claims[_I_]=0; end;&lt;/P&gt;&lt;P&gt;you can do similar for the character variables.&lt;/P&gt;&lt;P&gt;The condition you need might be something like&lt;/P&gt;&lt;P&gt;if sum(of claims(*))=0 then ..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 15:08:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Setting-blank-cells-to-0-after-merge/m-p/168845#M43667</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-08-20T15:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Setting blank cells to 0 after merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Setting-blank-cells-to-0-after-merge/m-p/168846#M43668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc stdize data=combined reponly missing=0;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 15:13:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Setting-blank-cells-to-0-after-merge/m-p/168846#M43668</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-08-20T15:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Setting blank cells to 0 after merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Setting-blank-cells-to-0-after-merge/m-p/168847#M43669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's my code but I'm not sure what to put inside &amp;lt;condition to determine no claims info&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I obviously know the condition - it's if the cell is . then populate it with 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data test1;&lt;/P&gt;&lt;P&gt;set combined;&lt;/P&gt;&lt;P&gt;array claims&amp;lt;total_incurred total_no total_outstanding&amp;gt;;&lt;/P&gt;&lt;P&gt;if &amp;lt; .&amp;nbsp; &amp;gt; then do _I_ to dim(claims) ; claims[_I_] = 0; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm getting errors such as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"too many array subscripts specified..."&lt;/P&gt;&lt;P&gt;"Syntax error expecting one or more..."&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 15:31:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Setting-blank-cells-to-0-after-merge/m-p/168847#M43669</guid>
      <dc:creator>brophymj</dc:creator>
      <dc:date>2014-08-20T15:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Setting blank cells to 0 after merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Setting-blank-cells-to-0-after-merge/m-p/168848#M43670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;brophymj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's one piece of the puzzle.&amp;nbsp; There's a standard way to determine whether there is a matching claims record or not.&amp;nbsp; This should become part of your tool kit:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data combined;&lt;/P&gt;&lt;P&gt;&amp;nbsp; merge exposure (in=a) claims (in=b);&lt;/P&gt;&lt;P&gt;&amp;nbsp; by key;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if a;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if b=0 then do;&amp;nbsp;&amp;nbsp; /* no claims record */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You also may have to think a little harder about the solution.&amp;nbsp; Could there be a variable in the EXPOSURE data set that contains a blank?&amp;nbsp; Would it be appropriate to set that variable to 0 (or to "N/A") when there is no claims data?&amp;nbsp; That can happen if you are not careful with the coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 15:43:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Setting-blank-cells-to-0-after-merge/m-p/168848#M43670</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-08-20T15:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Setting blank cells to 0 after merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Setting-blank-cells-to-0-after-merge/m-p/168849#M43671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you simply modify after merging?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data Combined;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Modify Combined;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Array N _NUMERIC_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Do over N;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Missing (N) Then N=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; End;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 17:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Setting-blank-cells-to-0-after-merge/m-p/168849#M43671</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2014-08-20T17:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Setting blank cells to 0 after merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Setting-blank-cells-to-0-after-merge/m-p/168850#M43672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is one solution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Prepare some data&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;data a;&lt;/P&gt;&lt;P&gt;length sexsmall $ 4;&lt;/P&gt;&lt;P&gt;set sashelp.class (obs=10);&lt;/P&gt;&lt;P&gt;sexsmall=sex;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rename age=agesmall weight=weightsmall height=heightsmall ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop sex;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Working code&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;data b;&lt;/P&gt;&lt;P&gt;merge&amp;nbsp; sashelp.class (in=a) a (in=b);&lt;/P&gt;&lt;P&gt;array allnum&amp;nbsp; sexsmall-numeric-weightsmall;&lt;/P&gt;&lt;P&gt;array allchar&amp;nbsp; sexsmall-character-weightsmall;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by name;&lt;/P&gt;&lt;P&gt;if b=0 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do over allnum; allnum=0; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do over allchar; allchar="N/A"; end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 20:12:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Setting-blank-cells-to-0-after-merge/m-p/168850#M43672</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2014-08-20T20:12:56Z</dc:date>
    </item>
  </channel>
</rss>

