<?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 SUBSTR function Not working! Please help me to solve  the following: in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SUBSTR-function-Not-working-Please-help-me-to-solve-the/m-p/93650#M19747</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 1. I need to delete 10 digits from right including @ sign on email account and leave only login name for Account ID column (i.e. mjohn)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2. You may also notice – if the names are repeated, email account is attached in parenthesis with their names. I will also need to remove the email account including&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the parenthesis from Full Name column if the names have their email account attached (i.e. Tom Lee (&lt;A href="mailto:tlee2@gmail.com"&gt;tlee2@gmail.com&lt;/A&gt;) = Tom Lee)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Roger&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Input data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Full_Name Account_ID&lt;/P&gt;&lt;P&gt;------------ --------------&lt;/P&gt;&lt;P&gt;Mary Johnson&amp;nbsp; &lt;A href="mailto:mjohn@gmail.com"&gt;mjohn@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Mary Jonson (&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:mjohn2@gmail.com"&gt;mjohn2@gmail.com&lt;/A&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;A href="mailto:mjohn2@gmail.com"&gt;mjohn2@gmail.com&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Robin King &lt;A href="mailto:rking@gmail.com"&gt;rking@gmail.com&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Tom Lee &lt;A href="mailto:tlee@gmail.com"&gt;tlee@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Tom Lee (&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:tlee2@gmail.com"&gt;tlee2@gmail.com&lt;/A&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:tlee2@gmail.com"&gt;tlee2@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Need the following output:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Full_Name Account_ID&lt;/P&gt;&lt;P&gt;------------ --------------&lt;/P&gt;&lt;P&gt;Mary Johnson&amp;nbsp; mjohn&lt;/P&gt;&lt;P&gt;Mary Jonson mjohn2&lt;/P&gt;&lt;P&gt;Robin King rking&lt;/P&gt;&lt;P&gt;Tom Lee tlee&lt;/P&gt;&lt;P&gt;Tom Lee tlee2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Oct 2012 21:38:45 GMT</pubDate>
    <dc:creator>Roger</dc:creator>
    <dc:date>2012-10-12T21:38:45Z</dc:date>
    <item>
      <title>SUBSTR function Not working! Please help me to solve  the following:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SUBSTR-function-Not-working-Please-help-me-to-solve-the/m-p/93650#M19747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 1. I need to delete 10 digits from right including @ sign on email account and leave only login name for Account ID column (i.e. mjohn)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2. You may also notice – if the names are repeated, email account is attached in parenthesis with their names. I will also need to remove the email account including&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the parenthesis from Full Name column if the names have their email account attached (i.e. Tom Lee (&lt;A href="mailto:tlee2@gmail.com"&gt;tlee2@gmail.com&lt;/A&gt;) = Tom Lee)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Roger&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Input data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Full_Name Account_ID&lt;/P&gt;&lt;P&gt;------------ --------------&lt;/P&gt;&lt;P&gt;Mary Johnson&amp;nbsp; &lt;A href="mailto:mjohn@gmail.com"&gt;mjohn@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Mary Jonson (&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:mjohn2@gmail.com"&gt;mjohn2@gmail.com&lt;/A&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;A href="mailto:mjohn2@gmail.com"&gt;mjohn2@gmail.com&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Robin King &lt;A href="mailto:rking@gmail.com"&gt;rking@gmail.com&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Tom Lee &lt;A href="mailto:tlee@gmail.com"&gt;tlee@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Tom Lee (&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:tlee2@gmail.com"&gt;tlee2@gmail.com&lt;/A&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:tlee2@gmail.com"&gt;tlee2@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Need the following output:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Full_Name Account_ID&lt;/P&gt;&lt;P&gt;------------ --------------&lt;/P&gt;&lt;P&gt;Mary Johnson&amp;nbsp; mjohn&lt;/P&gt;&lt;P&gt;Mary Jonson mjohn2&lt;/P&gt;&lt;P&gt;Robin King rking&lt;/P&gt;&lt;P&gt;Tom Lee tlee&lt;/P&gt;&lt;P&gt;Tom Lee tlee2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 21:38:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SUBSTR-function-Not-working-Please-help-me-to-solve-the/m-p/93650#M19747</guid>
      <dc:creator>Roger</dc:creator>
      <dc:date>2012-10-12T21:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: SUBSTR function Not working! Please help me to solve  the following:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SUBSTR-function-Not-working-Please-help-me-to-solve-the/m-p/93651#M19748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could try something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have (drop=_:);&lt;/P&gt;&lt;P&gt;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;&amp;nbsp; _infile_=transtrn(_infile_,"(","");&lt;/P&gt;&lt;P&gt;&amp;nbsp; call scan(_infile_, 2, _position, _length, '@', 'o');&lt;/P&gt;&lt;P&gt;&amp;nbsp; call scan(substr(_infile_,1,_position-2), -1,_position2, _length2);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Full_Name=strip(substr(_infile_,1,_position2-1));&lt;/P&gt;&lt;P&gt;&amp;nbsp; Account_ID=substr(_infile_,_position2,_length2);&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Mary Johnson&amp;nbsp; &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:mjohn@gmail.com"&gt;mjohn@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Mary Jonson (&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:mjohn2@gmail.com"&gt;mjohn2@gmail.com&lt;/A&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:mjohn2@gmail.com"&gt;mjohn2@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Robin King &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:rking@gmail.com"&gt;rking@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Tom Lee &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:tlee@gmail.com"&gt;tlee@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Tom Lee (&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:tlee2@gmail.com"&gt;tlee2@gmail.com&lt;/A&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:tlee2@gmail.com"&gt;tlee2@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 15:10:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SUBSTR-function-Not-working-Please-help-me-to-solve-the/m-p/93651#M19748</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-11-29T15:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: SUBSTR function Not working! Please help me to solve  the following:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SUBSTR-function-Not-working-Please-help-me-to-solve-the/m-p/93652#M19749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a PRX approach:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have (drop=_:);&lt;/P&gt;&lt;P&gt;length full_name account_id $40.;&lt;/P&gt;&lt;P&gt;_name=prxparse("/[^@\(\)]+ /");&lt;/P&gt;&lt;P&gt;_id=prxparse("/\w+(?=@)/");&lt;/P&gt;&lt;P&gt;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call prxsubstr(_name,_infile_,_s1,_l1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; call prxsubstr(_id,_infile_,_s2,_l2);&lt;/P&gt;&lt;P&gt;&amp;nbsp; full_name=substr(_infile_,_s1,_l1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; account_id=substr(_infile_,_s2,_l2);&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Mary Johnson &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:mjohn@gmail.com"&gt;mjohn@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Mary Jonson (&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:mjohn2@gmail.com"&gt;mjohn2@gmail.com&lt;/A&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:mjohn2@gmail.com"&gt;mjohn2@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Robin King &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:rking@gmail.com"&gt;rking@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Tom Lee &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:tlee@gmail.com"&gt;tlee@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Tom Lee (&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:tlee2@gmail.com"&gt;tlee2@gmail.com&lt;/A&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:tlee2@gmail.com"&gt;tlee2@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 17:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SUBSTR-function-Not-working-Please-help-me-to-solve-the/m-p/93652#M19749</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-11-29T17:18:04Z</dc:date>
    </item>
  </channel>
</rss>

