<?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: Testing for missing character not working in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Testing-for-missing-character-not-working/m-p/233563#M42658</link>
    <description>&lt;P&gt;Paige,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This was very helpful. Thank you very much.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Asim&lt;/P&gt;</description>
    <pubDate>Fri, 06 Nov 2015 21:06:13 GMT</pubDate>
    <dc:creator>asimraja</dc:creator>
    <dc:date>2015-11-06T21:06:13Z</dc:date>
    <item>
      <title>Testing for missing character not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Testing-for-missing-character-not-working/m-p/233515#M42644</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By applying a character format, I am creating a character based field. One of the values in the newly created character field is ' ' (single space between quotes). However, when I try to test for this value in an "if condition", nothing seems to work. I have tried applying compress function, missing function. The code snippet is below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please advise me how can I check if the value is ' '?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks in advance!&lt;/P&gt;
&lt;P&gt;Asim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Character Format&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;------------------------&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;proc format library = mapbook;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;value $FG_Format &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;'AMBAC' = 'AMBAC'&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;'MBIA' = 'NPFG (MBIA subsidiary)'&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;'FGIC-MBIA' = 'NPFG (MBIA subsidiary)' &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;'FGIC'&amp;nbsp;&amp;nbsp; &amp;nbsp;= 'NPFG (MBIA subsidiary)'&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;'XL Capital' = 'Syncora (formerly XL Capital)'&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;'FSA' = 'Assured Guarantee Municipal (formerly FSA)'&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;'HUD Cap Funds - AGM' = 'Assured Guarantee Municipal (formerly FSA)'&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;other =' ';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Creation of Character Field by applying the Character format&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;----------------------------------------------------------------------------------&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;data merged6;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length FG_3rd_Party $50;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FG_3rd_Party = Recourse_Group;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;format FG_3rd_Party $FG_Format.;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Test for missing Value in the Character Field&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;-------------------------------------------------------------&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if FG_3rd_Party in (' ') then&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;put FG_3rd_Party;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 18:56:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Testing-for-missing-character-not-working/m-p/233515#M42644</guid>
      <dc:creator>asimraja</dc:creator>
      <dc:date>2015-11-06T18:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Testing for missing character not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Testing-for-missing-character-not-working/m-p/233517#M42645</link>
      <description>&lt;P&gt;The code you have doesn't check the formatted value of the variable for a space, it checks the actual unformatted value of the variable for a space.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to test to see if the space is in the formatted value, you can use something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;b=find(put(FG_3rd_Party,$FG_Format.),' ');&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 18:59:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Testing-for-missing-character-not-working/m-p/233517#M42645</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-11-06T18:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Testing for missing character not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Testing-for-missing-character-not-working/m-p/233518#M42646</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While you "see" the formatted value, you haven't actually changed the variable in the dataset. You'll need to use something like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FG_3rd_Party = put(Recourse_Group,$FG_Format.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You'll see/be able to test for missing values at that point.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 19:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Testing-for-missing-character-not-working/m-p/233518#M42646</guid>
      <dc:creator>JoshB</dc:creator>
      <dc:date>2015-11-06T19:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Testing for missing character not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Testing-for-missing-character-not-working/m-p/233563#M42658</link>
      <description>&lt;P&gt;Paige,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This was very helpful. Thank you very much.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Asim&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 21:06:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Testing-for-missing-character-not-working/m-p/233563#M42658</guid>
      <dc:creator>asimraja</dc:creator>
      <dc:date>2015-11-06T21:06:13Z</dc:date>
    </item>
  </channel>
</rss>

