<?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: Isolating text in a variable field that contains both characters and numeric values? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Isolating-text-in-a-variable-field-that-contains-both-characters/m-p/156094#M30510</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;infile cards truncover;&lt;/P&gt;&lt;P&gt;input;&lt;/P&gt;&lt;P&gt;name=prxchange('s/.* Person (.*) \(.*/$1/io',-1,_infile_);&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;CUSIP NO. 90130N 10 3 - -------------- (1) Name of Reporting PersonS.S. or I.R.S. Identification No. of Above Person American International Group, Inc. (I.R.S. Identification No. 13-2592361) - ---&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Jun 2014 00:38:46 GMT</pubDate>
    <dc:creator>slchen</dc:creator>
    <dc:date>2014-06-26T00:38:46Z</dc:date>
    <item>
      <title>Isolating text in a variable field that contains both characters and numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Isolating-text-in-a-variable-field-that-contains-both-characters/m-p/156093#M30509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If someone can help with this problem, you will make life!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a variable ("paragraph") that has random output data with both characters and numeric value. For example, one observation looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CUSIP NO. 90130N 10 3 - --------------------- - -------------------------------------------------------------------------------- (1) Name of Reporting PersonS.S. or I.R.S. Identification No. of Above Person &lt;SPAN style="text-decoration: underline;"&gt;American International Group, Inc&lt;/SPAN&gt;. (I.R.S. Identification No. 13-2592361) - --------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried parse macros and explode macros but the data seems to be too messy for both of these. The only information I need is the underlined part (American International Group, Inc.), but I have no idea how to tell SAS to do this. Furthermore, there's no standardization between observations and the information I need from each observation changes. Said differently, I need the name of each reporting person, which changes with each observation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be very much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 23:36:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Isolating-text-in-a-variable-field-that-contains-both-characters/m-p/156093#M30509</guid>
      <dc:creator>kapow</dc:creator>
      <dc:date>2014-06-25T23:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Isolating text in a variable field that contains both characters and numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Isolating-text-in-a-variable-field-that-contains-both-characters/m-p/156094#M30510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;infile cards truncover;&lt;/P&gt;&lt;P&gt;input;&lt;/P&gt;&lt;P&gt;name=prxchange('s/.* Person (.*) \(.*/$1/io',-1,_infile_);&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;CUSIP NO. 90130N 10 3 - -------------- (1) Name of Reporting PersonS.S. or I.R.S. Identification No. of Above Person American International Group, Inc. (I.R.S. Identification No. 13-2592361) - ---&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 00:38:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Isolating-text-in-a-variable-field-that-contains-both-characters/m-p/156094#M30510</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2014-06-26T00:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Isolating text in a variable field that contains both characters and numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Isolating-text-in-a-variable-field-that-contains-both-characters/m-p/156095#M30511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using Regular Expressions feels like the way to go. In order to come up with a RegEx realistic for your data could you please provide some more sample data (as heterogeneous as possible). &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 08:50:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Isolating-text-in-a-variable-field-that-contains-both-characters/m-p/156095#M30511</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-06-26T08:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Isolating text in a variable field that contains both characters and numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Isolating-text-in-a-variable-field-that-contains-both-characters/m-p/156096#M30512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Irrespective of solution, e.g. RegEx, or index+substr or something else, you would need to have some indicator of where the data you want starts and ends.&amp;nbsp; If it is the word person and (, then its pretty straightforward,&lt;/P&gt;&lt;P&gt;substr(text,index(text,"Person")+1,length(text)-index(text,"(I.R.S"));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 09:03:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Isolating-text-in-a-variable-field-that-contains-both-characters/m-p/156096#M30512</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-06-26T09:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Isolating text in a variable field that contains both characters and numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Isolating-text-in-a-variable-field-that-contains-both-characters/m-p/156097#M30513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep - that's why I'm asking for more sample data so that we can get an idea if there is a pattern at all which allows us to identify the wanted sub-string.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 09:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Isolating-text-in-a-variable-field-that-contains-both-characters/m-p/156097#M30513</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-06-26T09:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Isolating text in a variable field that contains both characters and numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Isolating-text-in-a-variable-field-that-contains-both-characters/m-p/156098#M30514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help with this request! Some additional examples are below. I've underlined the part I need. It seems like the text I need either follows "(entities only)" or is sandwiched between "name of reporting persons." and "I.R.S. Identification." &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 NAMES OF REPORTING PERSONS &lt;SPAN style="text-decoration: underline;"&gt;CLARUS CAPITAL GROUP MANAGEMENT LP&lt;/SPAN&gt;I.R.S. IDENTIFICATION NO. OF ABOVE PERSON (ENTITIES ONLY)20-8098367&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SCHEDULE 13D CUSIP No. 068306109 1) NAMES OF REPORTING PERSONS I.R.S. IDENTIFICATION NOS. OF ABOVE PERSONS (ENTITIES ONLY) &lt;SPAN style="text-decoration: underline;"&gt;Bernard C. Sherman&lt;/SPAN&gt; 2) CHECK THE APPROPRIATE BOX IF A MEMBER OF A GROUP (SEE INSTRUCTIONS)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Names of Reporting Persons. I.R.S. Identification Nos. of above persons (entities only) &lt;SPAN style="text-decoration: underline;"&gt;Textron Inc&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 NAMES OF REPORTING PERSONS &lt;SPAN style="text-decoration: underline;"&gt;Lonnie J. Stout II&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1. Names of Reporting Persons. P STYLEmargin-top0pxmargin-bottom0pxI.R.S. Identification Nos. of above persons (entities only) P STYLEmargin-top0pxmargin-bottom1px&lt;SPAN style="text-decoration: underline;"&gt;Wal-Mart Stores, Inc.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 14:31:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Isolating-text-in-a-variable-field-that-contains-both-characters/m-p/156098#M30514</guid>
      <dc:creator>kapow</dc:creator>
      <dc:date>2014-06-26T14:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Isolating text in a variable field that contains both characters and numeric values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Isolating-text-in-a-variable-field-that-contains-both-characters/m-p/156099#M30515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;length a $ 200;&lt;/P&gt;&lt;P&gt;a='1 NAMES OF REPORTING PERSONS CLARUS CAPITAL GROUP MANAGEMENT LPI.R.S. IDENTIFICATION NO. OF ABOVE PERSON (ENTITIES ONLY)20-8098367 ';output;&lt;/P&gt;&lt;P&gt;a='SCHEDULE 13D CUSIP No. 068306109 1) NAMES OF REPORTING PERSONS I.R.S. IDENTIFICATION NOS. OF ABOVE PERSONS (ENTITIES ONLY) Bernard C. Sherman 2) CHECK THE APPROPRIATE BOX IF A MEMBER OF A GROUP (SEE INSTRUCTIONS)';output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;re = prxparse('/NAMES OF REPORTING PERSONS(.+)I\.R\.S\./io');&lt;/P&gt;&lt;P&gt;if prxmatch(re, a) then first = prxposn(re, 1, a);&lt;/P&gt;&lt;P&gt;if missing(first) then do;&lt;/P&gt;&lt;P&gt;re = prxparse('/ENTITIES ONLY\)(\D+)/io');&lt;/P&gt;&lt;P&gt;if prxmatch(re, a) then first = prxposn(re, 1, a);&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 13:32:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Isolating-text-in-a-variable-field-that-contains-both-characters/m-p/156099#M30515</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-06-27T13:32:15Z</dc:date>
    </item>
  </channel>
</rss>

