<?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: Remove values in a field and create new field in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303838#M20603</link>
    <description>&lt;P&gt;Many valid programming styles exist.&amp;nbsp; Consider whether you would want to use this variation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; TaskOtherII in : (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Phone Calls',&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Data Analysis'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Outreach'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Emails',&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Outreach')&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; TaskOtherII=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Oct 2016 17:28:07 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-10-11T17:28:07Z</dc:date>
    <item>
      <title>Remove values in a field and create new field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303701#M20580</link>
      <description>&lt;P&gt;I have a field called "Task". Examples of values in the field:&lt;/P&gt;&lt;P&gt;Text1;#Text2;#Text3;#Text_to_keep&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Is the a way to remove ( in the example) "Text1", "Text2" and ""Text3" and create a new field called "TaskOther" and populate this field with whatever is left over?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The last value in "Task" field is a free text input and can be anything. The are 17 other pre-defined selections in this field for users to select. They can select none or all of these.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll still want to keep the orginal field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope there is something out there for this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Haydn&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 02:16:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303701#M20580</guid>
      <dc:creator>Haydn</dc:creator>
      <dc:date>2016-10-11T02:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Remove values in a field and create new field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303703#M20581</link>
      <description>&lt;P&gt;If the field you are trying to extract is always the last one, the task is relatively simple:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TaskOther = scan(task, -1, '#');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is some other pattern to what you are trying to extract, you'll have to spell it out.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 02:35:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303703#M20581</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-10-11T02:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Remove values in a field and create new field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303704#M20582</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for that. Unfortunately it wont always be the last one. The field can contain nothing or the&amp;nbsp;free text input&amp;nbsp;wont alway's be the last value. If the users does use the free text field it will be the last value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are 17 values (excluding whatever the user inputs into the free text field)&amp;nbsp;that I will now could be in the field and I was hoping to hard code these and leave whatever is left.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 02:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303704#M20582</guid>
      <dc:creator>Haydn</dc:creator>
      <dc:date>2016-10-11T02:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Remove values in a field and create new field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303705#M20583</link>
      <description>&lt;P&gt;So what happens with an unselected field? &amp;nbsp;Does it literally contain "Text1" or "Text2" (etc.)?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 02:50:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303705#M20583</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-10-11T02:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Remove values in a field and create new field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303708#M20584</link>
      <description>it would contain nothing.</description>
      <pubDate>Tue, 11 Oct 2016 02:59:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303708#M20584</guid>
      <dc:creator>Haydn</dc:creator>
      <dc:date>2016-10-11T02:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Remove values in a field and create new field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303710#M20585</link>
      <description>&lt;P&gt;Here's a way to search through the text, until you find a useful piece:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;length TextOther $ 50;&lt;/P&gt;
&lt;P&gt;do i=1 to 30 until (TextOther &amp;gt; ' ');&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;TextOther = scan(Task, i, '#;');&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;if TextOther =: 'Text' then TextOther=' ';&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This assumes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;There won't be more than 30 parts to the original TASK,&lt;/LI&gt;
&lt;LI&gt;The text that you want to save does not begin with "Text", and&lt;/LI&gt;
&lt;LI&gt;All the values to be ignored do begin with "Text".&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 03:44:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303710#M20585</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-10-11T03:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Remove values in a field and create new field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303711#M20586</link>
      <description>&lt;P&gt;thanks for that. My apologies the Text1, text2 etc were examples only. Some examples of the output in this field is: "Community/Stakeholder Engagement;#Emails#ACBF"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In this case I'd like ACBF to be kept and all other values removed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code still works as is, except that it returns the 1st value in the field. Probably because I explained my requirements poorly in my 1st post. Again my apologies for this.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 03:54:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303711#M20586</guid>
      <dc:creator>Haydn</dc:creator>
      <dc:date>2016-10-11T03:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Remove values in a field and create new field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303713#M20587</link>
      <description>&lt;P&gt;I've used your code and made some changes. This dies give me my result,admittedly, I'll have to code a few more "if's". But this is great. Thanks again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; i=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;to&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;30&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;until&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (TaskOtherII &amp;gt; &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;TaskOtherII = scan(Task, i, &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'#;'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; TaskOtherII =: &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Phone Calls'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; TaskOtherII=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; TaskOtherII =: &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Data Analysis'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; TaskOtherII=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; TaskOtherII =: &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Outreach'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; TaskOtherII=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; TaskOtherII =: &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Emails'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; TaskOtherII=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; TaskOtherII =: &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Outreach'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; TaskOtherII=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 04:14:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303713#M20587</guid>
      <dc:creator>Haydn</dc:creator>
      <dc:date>2016-10-11T04:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Remove values in a field and create new field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303715#M20588</link>
      <description>&lt;P&gt;If you give us some sample data which is representative of what you're really dealing with then may be we can come-up with an approach which is both simple and fully working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See example code below which is based on the assumption that your wanted sub-string is always at the end of&amp;nbsp;your string.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
/* example for data where the wanted sub-string is always at the end of the string */
data have;
  infile datalines truncover;
  input have_str $80.;
  datalines;
Phone Calls##Outreach#Emails#Outreach#Wanted String
Phone Calls#Data Analysis#Outreach#Emails#Outreach#Wanted String
Phone Calls#Data Analysis#Outreach#Emails#Outreach#
Phone Calls#Data Analysis#Outreach#Emails#Outreach#Wanted String
##Outreach###
##Outreach###Wanted String
;
run;

data want;
  set have;
  length want_str $20;
  want_str=scan(have_str,-1,'#','m');
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 04:44:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303715#M20588</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-10-11T04:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Remove values in a field and create new field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303838#M20603</link>
      <description>&lt;P&gt;Many valid programming styles exist.&amp;nbsp; Consider whether you would want to use this variation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; TaskOtherII in : (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Phone Calls',&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Data Analysis'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Outreach'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Emails',&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Outreach')&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; TaskOtherII=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 17:28:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-values-in-a-field-and-create-new-field/m-p/303838#M20603</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-10-11T17:28:07Z</dc:date>
    </item>
  </channel>
</rss>

