<?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 Fill in Blanks with 'NA' in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321227#M70888</link>
    <description>&lt;P&gt;Hello~&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to replace blanks (which were not noted as '.', see attachment, line5, line8-9, line13-14) with 'NA' by&amp;nbsp;if location =' ' then 'NA'; but nothing happened. Please help. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13284i302AB54FBEDC08D9/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="20161226220050.jpg" title="20161226220050.jpg" /&gt;</description>
    <pubDate>Tue, 27 Dec 2016 04:01:47 GMT</pubDate>
    <dc:creator>may0423</dc:creator>
    <dc:date>2016-12-27T04:01:47Z</dc:date>
    <item>
      <title>Fill in Blanks with 'NA'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321227#M70888</link>
      <description>&lt;P&gt;Hello~&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to replace blanks (which were not noted as '.', see attachment, line5, line8-9, line13-14) with 'NA' by&amp;nbsp;if location =' ' then 'NA'; but nothing happened. Please help. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13284i302AB54FBEDC08D9/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="20161226220050.jpg" title="20161226220050.jpg" /&gt;</description>
      <pubDate>Tue, 27 Dec 2016 04:01:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321227#M70888</guid>
      <dc:creator>may0423</dc:creator>
      <dc:date>2016-12-27T04:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Fill in Blanks with 'NA'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321230#M70890</link>
      <description>&lt;P&gt;You can try missing function:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF Missing(Location) then Location = 'NA';&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 04:09:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321230#M70890</guid>
      <dc:creator>mnjtrana</dc:creator>
      <dc:date>2016-12-27T04:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Fill in Blanks with 'NA'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321231#M70891</link>
      <description>&lt;P&gt;thank you for the quick response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it doesn't work......T.T&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 04:14:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321231#M70891</guid>
      <dc:creator>may0423</dc:creator>
      <dc:date>2016-12-27T04:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Fill in Blanks with 'NA'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321233#M70892</link>
      <description>&lt;P&gt;Post your code and log please&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 04:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321233#M70892</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-27T04:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Fill in Blanks with 'NA'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321234#M70893</link>
      <description>&lt;P&gt;There are some unprintable character other than white blank.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
location='      ';output;
location='09'x;output;
location='xxxxxx';output;
run;
data x;
 set x;
 if prxmatch('/^\s+$/',location) then new='NA        ';
  else new=location;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Dec 2016 04:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321234#M70893</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-12-27T04:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Fill in Blanks with 'NA'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321235#M70894</link>
      <description>&lt;P&gt;Besides, how could I extract the location between&amp;nbsp; &amp;lt;dt&amp;gt;Location&amp;lt;/dt&amp;gt; &amp;lt;dd&amp;gt; and&amp;nbsp;&amp;lt;/dd&amp;gt;? (see attachment)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data testlocation;&lt;BR /&gt;filename indata url '&lt;A href="http://forums.vwvortex.com/showthread.php?7286873-To-our-readers" target="_blank"&gt;http://forums.vwvortex.com/showthread.php?7286873-To-our-readers&lt;/A&gt;' lrecl=10000;&lt;BR /&gt;infile indata length=len;&lt;BR /&gt;input record $varying10000. len;&lt;BR /&gt;input @ '&amp;lt;dt&amp;gt;Join Date&amp;lt;/dt&amp;gt; &amp;lt;dd&amp;gt;' / location :&amp;amp;$10000. ;&lt;BR /&gt;if location = ' ’ then location = ‘NA’;&lt;/P&gt;&lt;P&gt;data order_location;&lt;BR /&gt;set work. testlocation;&lt;BR /&gt;rank_num=_n_;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 04:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321235#M70894</guid>
      <dc:creator>may0423</dc:creator>
      <dc:date>2016-12-27T04:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Fill in Blanks with 'NA'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321236#M70895</link>
      <description>&lt;P&gt;I just adapted&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt; &lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;prxmatch&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'/^\s+$/'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;location&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; new&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'NA        '&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token keyword"&gt;else&lt;/SPAN&gt; new&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;location&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;a little bit. It worked! thank you&amp;nbsp;&lt;SPAN class="login-bold"&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408" target="_self"&gt;Ksharp&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 04:37:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321236#M70895</guid>
      <dc:creator>may0423</dc:creator>
      <dc:date>2016-12-27T04:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Fill in Blanks with 'NA'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321237#M70896</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/120811"&gt;@may0423&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;see attachment&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A picture attachment is not helpful. If we want to mock up code we have to manually type out your data. &amp;nbsp;If you have blank characters besides spaces there's no way to check.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Post as text or a SAS dataset but posting an image is not very useful.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 04:38:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321237#M70896</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-27T04:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Fill in Blanks with 'NA'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321240#M70899</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename indata url 'http://forums.vwvortex.com/showthread.php?7286873-To-our-readers' lrecl=10000;

data testlocation;
infile indata length=len;
input record $varying10000. len;
retain start;
if record =: '&amp;lt;body&amp;gt;' then start=1;
if start then do;
 record=prxchange('s/\&amp;lt;[^\&amp;lt;\&amp;gt;]+\&amp;gt;//',-1,record);
 if not prxmatch('/^\s+$/',record) then output;
end;
run;


data want;
 set testlocation;
 lag=lag(record);
 if prxmatch('/^\s*View Profile/',record) then do;record=lag;output;end;
 if prxmatch('/^\s*(Join Date|Location|Posts)/',record) then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Dec 2016 05:01:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fill-in-Blanks-with-NA/m-p/321240#M70899</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-12-27T05:01:50Z</dc:date>
    </item>
  </channel>
</rss>

