<?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 Extracting from a string with various lengths of character on each side in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extracting-from-a-string-with-various-lengths-of-character-on/m-p/422862#M27262</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I posted a similar question before only to realize the need was different that what I originally thought. I have a string with an ID that I need to extract. There are varying lengths of characters on either side of this ID making it difficult for me to specify the location to work from. I have noticed that there are always seven underscores before the the ID is found, but I'm not sure if that helps at all with locating the ID. Not sure if there's some sort of SUBSTR function that could be used&amp;nbsp;for this in proc sql.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example of the data from my table named "tracking" with the ID that I need in bold:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hraccact_email_acquisition_NA_ENG_20170222_gpsubscrip_&lt;STRONG&gt;HIL17TRANSS10EN1T33&lt;/STRONG&gt;_A-509469751O&lt;/P&gt;&lt;P&gt;hrmessage_email_announcenews_NA_ENG_20170302_hrsubscrip_&lt;STRONG&gt;H0042100144510381EN&lt;/STRONG&gt;_A-533270247X&lt;/P&gt;&lt;P&gt;hresum_email_HSUM0117_AS_ENG_20170124_stspecial_&lt;STRONG&gt;H0040055123110381EN&lt;/STRONG&gt;_A-532246836E&lt;SPAN&gt;N?stop_mobi=yes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Dec 2017 19:56:05 GMT</pubDate>
    <dc:creator>Dogo23</dc:creator>
    <dc:date>2017-12-20T19:56:05Z</dc:date>
    <item>
      <title>Extracting from a string with various lengths of character on each side</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extracting-from-a-string-with-various-lengths-of-character-on/m-p/422862#M27262</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I posted a similar question before only to realize the need was different that what I originally thought. I have a string with an ID that I need to extract. There are varying lengths of characters on either side of this ID making it difficult for me to specify the location to work from. I have noticed that there are always seven underscores before the the ID is found, but I'm not sure if that helps at all with locating the ID. Not sure if there's some sort of SUBSTR function that could be used&amp;nbsp;for this in proc sql.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example of the data from my table named "tracking" with the ID that I need in bold:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hraccact_email_acquisition_NA_ENG_20170222_gpsubscrip_&lt;STRONG&gt;HIL17TRANSS10EN1T33&lt;/STRONG&gt;_A-509469751O&lt;/P&gt;&lt;P&gt;hrmessage_email_announcenews_NA_ENG_20170302_hrsubscrip_&lt;STRONG&gt;H0042100144510381EN&lt;/STRONG&gt;_A-533270247X&lt;/P&gt;&lt;P&gt;hresum_email_HSUM0117_AS_ENG_20170124_stspecial_&lt;STRONG&gt;H0040055123110381EN&lt;/STRONG&gt;_A-532246836E&lt;SPAN&gt;N?stop_mobi=yes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 19:56:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extracting-from-a-string-with-various-lengths-of-character-on/m-p/422862#M27262</guid>
      <dc:creator>Dogo23</dc:creator>
      <dc:date>2017-12-20T19:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting from a string with various lengths of character on each side</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extracting-from-a-string-with-various-lengths-of-character-on/m-p/422869#M27263</link>
      <description>&lt;P&gt;Did you try the SCAN() function?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;scan(string,8,'_')&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Dec 2017 20:28:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extracting-from-a-string-with-various-lengths-of-character-on/m-p/422869#M27263</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-12-20T20:28:48Z</dc:date>
    </item>
  </channel>
</rss>

