<?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 extract string from a character variable? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-string-from-a-character-variable/m-p/123541#M259949</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow, this is concise!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jul 2013 00:36:24 GMT</pubDate>
    <dc:creator>caveman529</dc:creator>
    <dc:date>2013-07-10T00:36:24Z</dc:date>
    <item>
      <title>How to extract string from a character variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-string-from-a-character-variable/m-p/123536#M259944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, everyone:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wondering how to extract the red portion of the following strings?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;client/data/20/&lt;SPAN style="color: #ff0000;"&gt;0000893220-98-000530&lt;/SPAN&gt;.txt&lt;/P&gt;&lt;P&gt;client/data/810084/&lt;SPAN style="color: #ff0000;"&gt;0001193125-08-059176&lt;/SPAN&gt;.txt&lt;/P&gt;&lt;P&gt;client/data/914208/&lt;SPAN style="color: #ff0000;"&gt;0000950129-07-000703&lt;/SPAN&gt;.txt&lt;/P&gt;&lt;P&gt;client/data/1036213/&lt;SPAN style="color: #ff0000;"&gt;0001036213-98-000015&lt;/SPAN&gt;.txt&lt;/P&gt;&lt;P&gt;client/data/1103345/&lt;SPAN style="color: #ff0000;"&gt;0001103345-05-000031&lt;/SPAN&gt;.txt&lt;/P&gt;&lt;P&gt;client/data/1161175/&lt;SPAN style="color: #ff0000;"&gt;0000950123-10-012321&lt;/SPAN&gt;.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The red string always fall between the third slash and the .txt portion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand I need to use anypunct and anynum to solve this problem.&amp;nbsp; However, after several try, I still get 0.&amp;nbsp; Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2013 05:21:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-string-from-a-character-variable/m-p/123536#M259944</guid>
      <dc:creator>caveman529</dc:creator>
      <dc:date>2013-07-01T05:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract string from a character variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-string-from-a-character-variable/m-p/123537#M259945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;data _null_;
input x $100.;
y=scan(x,-2,'./');
put x= y=;
cards;
client/data/20/0000893220-98-000530.txt
client/data/810084/0001193125-08-059176.txt
client/data/914208/0000950129-07-000703.txt
client/data/1036213/0001036213-98-000015.txt
client/data/1103345/0001103345-05-000031.txt
client/data/1161175/0000950123-10-012321.txt
;
run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2013 06:05:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-string-from-a-character-variable/m-p/123537#M259945</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-07-01T06:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract string from a character variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-string-from-a-character-variable/m-p/123538#M259946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ksharp solution is Perfect , But when I tried it skipped alternate rows. A little modification just by adding " &lt;STRONG&gt;:&lt;/STRONG&gt; "&amp;nbsp; will work perfect.&amp;nbsp; Please try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;input x : $&amp;nbsp; 100.;&lt;/P&gt;&lt;P&gt;y=scan(x,4,'./');&lt;/P&gt;&lt;P&gt;put x= y=;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;client/data/20/0000893220-98-000530.txt&lt;/P&gt;&lt;P&gt;client/data/810084/0001193125-08-059176.txt&lt;/P&gt;&lt;P&gt;client/data/914208/0000950129-07-000703.txt&lt;/P&gt;&lt;P&gt;client/data/1036213/0001036213-98-000015.txt&lt;/P&gt;&lt;P&gt;client/data/1103345/0001103345-05-000031.txt&lt;/P&gt;&lt;P&gt;client/data/1161175/0000950123-10-012321.txt&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2013 06:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-string-from-a-character-variable/m-p/123538#M259946</guid>
      <dc:creator>sunilzood</dc:creator>
      <dc:date>2013-07-01T06:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract string from a character variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-string-from-a-character-variable/m-p/123539#M259947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Ksharp and sunilzood!&amp;nbsp; It works like charm on my data.&amp;nbsp; Could you explain a little bit of the more about the &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;y=scan(x,4,'./');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Especially, the 4 and ./ part, since there are multiple slashes...&amp;nbsp; Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2013 07:23:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-string-from-a-character-variable/m-p/123539#M259947</guid>
      <dc:creator>caveman529</dc:creator>
      <dc:date>2013-07-01T07:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract string from a character variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-string-from-a-character-variable/m-p/123540#M259948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;4 means the fourth part.&lt;/P&gt;&lt;P&gt;./ means take both . and / as separator .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2013 07:31:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-string-from-a-character-variable/m-p/123540#M259948</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-07-01T07:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract string from a character variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-string-from-a-character-variable/m-p/123541#M259949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow, this is concise!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2013 00:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-string-from-a-character-variable/m-p/123541#M259949</guid>
      <dc:creator>caveman529</dc:creator>
      <dc:date>2013-07-10T00:36:24Z</dc:date>
    </item>
  </channel>
</rss>

