<?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 Break down a string into shorter length in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Break-down-a-string-into-shorter-length/m-p/506361#M1303</link>
    <description>&lt;P&gt;I have a&amp;nbsp;field from a source system which is 800 characters long. The target system only allow 80 characters. If the string is more than 80 characters long, I must break it down into multiple records of 80 characters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note that the string vary in length. Therefore I must first calculate the length of each record/string.&lt;/P&gt;</description>
    <pubDate>Mon, 22 Oct 2018 07:51:24 GMT</pubDate>
    <dc:creator>Sir_Lancelot</dc:creator>
    <dc:date>2018-10-22T07:51:24Z</dc:date>
    <item>
      <title>Break down a string into shorter length</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Break-down-a-string-into-shorter-length/m-p/506361#M1303</link>
      <description>&lt;P&gt;I have a&amp;nbsp;field from a source system which is 800 characters long. The target system only allow 80 characters. If the string is more than 80 characters long, I must break it down into multiple records of 80 characters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note that the string vary in length. Therefore I must first calculate the length of each record/string.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 07:51:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Break-down-a-string-into-shorter-length/m-p/506361#M1303</guid>
      <dc:creator>Sir_Lancelot</dc:creator>
      <dc:date>2018-10-22T07:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Break down a string into shorter length</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Break-down-a-string-into-shorter-length/m-p/506362#M1304</link>
      <description>&lt;P&gt;Brute force attack:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data shortrec (drop=longfield);
set longrec;
length shortfield $80;
do while (length(longfield) &amp;gt; 0);
  shortfield = substr(longfield,1,80);
  output;
  longfield = substr(longfield,81);
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Oct 2018 07:56:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Break-down-a-string-into-shorter-length/m-p/506362#M1304</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-22T07:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: Break down a string into shorter length</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Break-down-a-string-into-shorter-length/m-p/506364#M1306</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;do while (length&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;n&lt;/FONT&gt;&lt;/STRONG&gt;(longfield) &amp;gt; 0);&lt;/PRE&gt;
&lt;P&gt;Otherwise, an infinite loop will occur.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 08:27:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Break-down-a-string-into-shorter-length/m-p/506364#M1306</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-22T08:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Break down a string into shorter length</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Break-down-a-string-into-shorter-length/m-p/506368#M1309</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;do while (length&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;n&lt;/FONT&gt;&lt;/STRONG&gt;(longfield) &amp;gt; 0);&lt;/PRE&gt;
&lt;P&gt;Otherwise, an infinite loop will occur.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I really hate the un-intuitiveness of length() in this regard.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 08:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Break-down-a-string-into-shorter-length/m-p/506368#M1309</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-22T08:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Break down a string into shorter length</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Break-down-a-string-into-shorter-length/m-p/506445#M1325</link>
      <description>&lt;P&gt;Seems to be running into an infinite loop. See below example string:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UPDATED BY : A134906 (BFC PTA:SUPPORT) Current employer: N/A Employer phone number: N/A Source of phone number: BDS Contact last name: N/A Contact first name: N/A Contact designation: N/A Employment restrictions: Basic salary: N/A Payment method: CREDIT TRANSFER COE capture user: A134906 Approved by: A134906&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 13:58:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Break-down-a-string-into-shorter-length/m-p/506445#M1325</guid>
      <dc:creator>Sir_Lancelot</dc:creator>
      <dc:date>2018-10-22T13:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Break down a string into shorter length</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Break-down-a-string-into-shorter-length/m-p/506447#M1326</link>
      <description>&lt;P&gt;As mentioned by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;, use lenghtn() instead of length().&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 14:02:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Break-down-a-string-into-shorter-length/m-p/506447#M1326</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-22T14:02:33Z</dc:date>
    </item>
  </channel>
</rss>

