<?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 spilt a value into three variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-spilt-a-value-into-three-variables/m-p/298378#M62742</link>
    <description>&lt;P&gt;Here's a recently asked question that only splits into 2 variables instead of 3 ... but all the same techniques would apply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/Split-variable-gt-200-char-into-fragments-lt-200-char-but-keep/m-p/297213" target="_blank"&gt;https://communities.sas.com/t5/General-SAS-Programming/Split-variable-gt-200-char-into-fragments-lt-200-char-but-keep/m-p/297213&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Sep 2016 17:05:52 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-09-14T17:05:52Z</dc:date>
    <item>
      <title>How to spilt a value into three variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-spilt-a-value-into-three-variables/m-p/298367#M62739</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in my raw data, a variable value contains characters longer than 200 characters in length. I need split the value into variable1, variable2, and so on depends on the number of charracters and each variable can contain maximum of 200 characters. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Variable&lt;/P&gt;&lt;P&gt;Site to document the deviation in the subject source. Sleep technician will receive addition protocol training for scoring requirements and procedures. Site reported the deviation to the investigator on 20JUN2013.Subject 32 Screening Mean sleep latency could not be determined for this subject as sleep latency was unknown for all of the MWT naps.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 16:30:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-spilt-a-value-into-three-variables/m-p/298367#M62739</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2016-09-14T16:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to spilt a value into three variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-spilt-a-value-into-three-variables/m-p/298378#M62742</link>
      <description>&lt;P&gt;Here's a recently asked question that only splits into 2 variables instead of 3 ... but all the same techniques would apply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/Split-variable-gt-200-char-into-fragments-lt-200-char-but-keep/m-p/297213" target="_blank"&gt;https://communities.sas.com/t5/General-SAS-Programming/Split-variable-gt-200-char-into-fragments-lt-200-char-but-keep/m-p/297213&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 17:05:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-spilt-a-value-into-three-variables/m-p/298378#M62742</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-14T17:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to spilt a value into three variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-spilt-a-value-into-three-variables/m-p/298380#M62743</link>
      <description>&lt;P&gt;You may try:&lt;/P&gt;&lt;P&gt;length var1-var&lt;STRONG&gt;5&lt;/STRONG&gt; $200; &amp;nbsp; /* assume max 5 variables to output */&lt;/P&gt;&lt;P&gt;array varx var1-var&lt;STRONG&gt;5&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var_len = length(var_in);&lt;/P&gt;&lt;P&gt;do i=1 to&lt;STRONG&gt; 5&lt;/STRONG&gt;; varx(i)=' '; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if var_len le 200 then var1 = var_in; &amp;nbsp;&lt;/P&gt;&lt;P&gt;else do ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; do until (var_len &amp;lt; 200);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;varx(i) = substr(var_in,(i-1)*200 +1, min(var_len, 200));&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var_len = var_len - 200;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 17:11:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-spilt-a-value-into-three-variables/m-p/298380#M62743</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-09-14T17:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to spilt a value into three variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-spilt-a-value-into-three-variables/m-p/298384#M62744</link>
      <description>oops, change the do until (var_len &amp;lt; 200); into&lt;BR /&gt;DO WHILE (VAR_LEN &amp;gt; 0(;</description>
      <pubDate>Wed, 14 Sep 2016 17:17:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-spilt-a-value-into-three-variables/m-p/298384#M62744</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-09-14T17:17:13Z</dc:date>
    </item>
  </channel>
</rss>

