<?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: Truncating a string into pieces? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Truncating-a-string-into-pieces/m-p/90050#M25697</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please refer this thread for your answer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="active_link" href="https://communities.sas.com/thread/48092"&gt;https://communities.sas.com/thread/48092&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Jul 2013 14:06:55 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2013-07-25T14:06:55Z</dc:date>
    <item>
      <title>Truncating a string into pieces?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Truncating-a-string-into-pieces/m-p/90049#M25696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SAS Forum,&lt;BR /&gt;I have a list of some 200 postal codes in the attached SAS data set as a string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to get the postal codes separated. The final data set that I want should look like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;postal_code&lt;/P&gt;&lt;P&gt;T1S0C3&lt;/P&gt;&lt;P&gt;T1S1A1&lt;/P&gt;&lt;P&gt;T1S1A2&lt;/P&gt;&lt;P&gt;T1S1A4&lt;/P&gt;&lt;P&gt;T1S1A5&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anyone help me to get the single string transformed into a data set like above?&lt;/P&gt;&lt;P&gt;Thank you for your time and expertise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mirisage&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 13:56:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Truncating-a-string-into-pieces/m-p/90049#M25696</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2013-07-25T13:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Truncating a string into pieces?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Truncating-a-string-into-pieces/m-p/90050#M25697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please refer this thread for your answer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="active_link" href="https://communities.sas.com/thread/48092"&gt;https://communities.sas.com/thread/48092&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 14:06:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Truncating-a-string-into-pieces/m-p/90050#M25697</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-07-25T14:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Truncating a string into pieces?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Truncating-a-string-into-pieces/m-p/90051#M25698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look at this code&lt;/P&gt;&lt;P&gt;COUNTW will count the "words" delimited by a blank, SCAN will get the proper string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Consolas; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; postalcodes;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp; postal_codes = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"T1S0C3 T1S1A1 T1S1A2 T1S1A4 T1S1A5 T1S1A6 T1S1A7 T1S1A8 T1S1A9 T1S1B1 T1S1B2"&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; postalCode $ &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;16&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; n_postalCodes = countw(postal_codes, &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; i = &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; n_postalCodes;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; postalCode = scan(postal_codes, i, &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;output&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;end&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; postal_codes &lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #ffffff;"&gt;/* n_postalCodes i */&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 14:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Truncating-a-string-into-pieces/m-p/90051#M25698</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2013-07-25T14:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Truncating a string into pieces?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Truncating-a-string-into-pieces/m-p/90052#M25699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bruno&lt;/P&gt;&lt;P&gt;Thank you very much, your code worked nicely and explanation is very helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Hai.kuo,&lt;/P&gt;&lt;P&gt;Mnay thanks for your link which is very helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mirisage&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 16:08:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Truncating-a-string-into-pieces/m-p/90052#M25699</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2013-07-26T16:08:23Z</dc:date>
    </item>
  </channel>
</rss>

