<?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: How to know weather the data set contains special characters in each variable or not in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-weather-the-data-set-contains-special-characters-in/m-p/463030#M117906</link>
    <description>&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff"&gt;Doesn't work&lt;/FONT&gt; &lt;/STRONG&gt;is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
    <pubDate>Thu, 17 May 2018 15:00:53 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-05-17T15:00:53Z</dc:date>
    <item>
      <title>How to know weather the data set contains special characters in each variable or not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-weather-the-data-set-contains-special-characters-in/m-p/462955#M117885</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data ds;&lt;/P&gt;&lt;P&gt;infile datalines;&lt;/P&gt;&lt;P&gt;input a$ b$ c$ d$ e$;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 2 as&amp;gt; sd&amp;lt; 78#&lt;/P&gt;&lt;P&gt;3 5 a&amp;gt;a sd&amp;lt; 78&amp;amp;&lt;/P&gt;&lt;P&gt;1 2 &amp;lt;ss sd&amp;lt; 78*&lt;/P&gt;&lt;P&gt;1 2 ss 3 84&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output may be like&amp;nbsp;&lt;/P&gt;&lt;P&gt;_n_&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 2 as&amp;gt; sd&amp;lt; 78#&lt;/P&gt;&lt;P&gt;3 5 a&amp;gt;a sd&amp;lt; 78&amp;amp;&lt;/P&gt;&lt;P&gt;1 2 &amp;lt;ss sd&amp;lt; 78*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data ds1;&lt;BR /&gt;array spc(93) _All_;&lt;BR /&gt;set work.ds nobs=nobs point=i;&lt;BR /&gt;do i=1 to dim(spc);&lt;BR /&gt;where spc(i) like (&amp;lt;%,&amp;gt;%,%&amp;gt;%,&amp;gt;%,%&amp;gt;,%&amp;gt;%);&lt;BR /&gt;end;&lt;BR /&gt;stop;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 09:32:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-weather-the-data-set-contains-special-characters-in/m-p/462955#M117885</guid>
      <dc:creator>srinath3111</dc:creator>
      <dc:date>2018-05-17T09:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to know weather the data set contains special characters in each variable or not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-weather-the-data-set-contains-special-characters-in/m-p/462964#M117886</link>
      <description>&lt;P&gt;Some information would be helpful.&amp;nbsp; Special characters normally refer to tabs, or carriage return etc.&amp;nbsp; I don't see any of these here?&lt;/P&gt;
&lt;P&gt;Do you just want to see if the string contains &amp;lt;, &amp;gt;, or %?&amp;nbsp; If so:&lt;/P&gt;
&lt;PRE&gt;data ds1;
  array spc{93} _all_;
  set work.ds;
  do i=1 to dim(spc);
    if lengthn(compress(spc{i},'&amp;lt;&amp;gt;%',"k")) then k=1;
  end;
  if k;
run;&lt;/PRE&gt;
&lt;P&gt;This goes over each variable, if the string when all but &amp;lt;&amp;gt;% are removed's length is greater than 0 then k is set to 1.&amp;nbsp; After all array elements are checked, if k is 1 then it gets output.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 10:03:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-weather-the-data-set-contains-special-characters-in/m-p/462964#M117886</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-05-17T10:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to know weather the data set contains special characters in each variable or not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-weather-the-data-set-contains-special-characters-in/m-p/463017#M117905</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesnt work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 14:37:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-weather-the-data-set-contains-special-characters-in/m-p/463017#M117905</guid>
      <dc:creator>srinath3111</dc:creator>
      <dc:date>2018-05-17T14:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to know weather the data set contains special characters in each variable or not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-weather-the-data-set-contains-special-characters-in/m-p/463030#M117906</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff"&gt;Doesn't work&lt;/FONT&gt; &lt;/STRONG&gt;is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 15:00:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-weather-the-data-set-contains-special-characters-in/m-p/463030#M117906</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-17T15:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to know weather the data set contains special characters in each variable or not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-weather-the-data-set-contains-special-characters-in/m-p/463197#M117965</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/186962"&gt;@srinath3111&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;You need to provide a bit more explanation in your posts. Don't forget that you're asking us to help you so please have the&amp;nbsp;courtesy and spend the time required to help us to help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Following the coding approach you've tried below code should do the job.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile datalines;
  input a$ b$ c$ d$ e$;
  datalines;
1 2 as&amp;gt; sd&amp;lt; 78#
3 5 a&amp;gt;a sd&amp;lt; 78&amp;amp;
1 2 &amp;lt;ss sd&amp;lt; 78*
1 2 ss 3 84
;
run;

data want(drop=_:);
  set work.have;
  array spc(*) _character_;
  do _i=1 to dim(spc);
    if notalnum(compress(spc[_i])) then
      do;
        row=_n_;
        output;
        leave;
      end;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 May 2018 00:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-weather-the-data-set-contains-special-characters-in/m-p/463197#M117965</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-05-18T00:28:14Z</dc:date>
    </item>
  </channel>
</rss>

