<?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: convert a string into multiple field in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/convert-a-string-into-multiple-field/m-p/54598#M15144</link>
    <description>Would something like the following suffice?:&lt;BR /&gt;
&lt;BR /&gt;
data want (drop=i classes);&lt;BR /&gt;
  informat classes $30.;&lt;BR /&gt;
  array class(3) $10.;&lt;BR /&gt;
  input name $ classes &amp;amp;;&lt;BR /&gt;
  classes=compress(classes,'"');&lt;BR /&gt;
  do i=1 to 3;&lt;BR /&gt;
    class(i)=scan(classes,i);&lt;BR /&gt;
  end;&lt;BR /&gt;
  cards;&lt;BR /&gt;
ram "history,math geography" &lt;BR /&gt;
hari "physics,, math chemistry"&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
Art&lt;BR /&gt;
---------&lt;BR /&gt;
&amp;gt; I have a raw dat  like &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt;  ram  "history,math  geography"  &lt;BR /&gt;
&amp;gt; ari   "physics,, math chemistry"&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I want to create a data set like &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; history   math  geography&lt;BR /&gt;
&amp;gt; physics   math  chemistry&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Message was edited by: arpit</description>
    <pubDate>Thu, 21 Apr 2011 12:37:51 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2011-04-21T12:37:51Z</dc:date>
    <item>
      <title>convert a string into multiple field</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/convert-a-string-into-multiple-field/m-p/54597#M15143</link>
      <description>I have a raw dat  like &lt;BR /&gt;
&lt;BR /&gt;
 ram  "history,math  geography"  &lt;BR /&gt;
hari   "physics,, math chemistry"&lt;BR /&gt;
&lt;BR /&gt;
I want to create a data set like &lt;BR /&gt;
&lt;BR /&gt;
history   math  geography&lt;BR /&gt;
physics   math  chemistry

Message was edited by: arpit</description>
      <pubDate>Thu, 21 Apr 2011 10:31:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/convert-a-string-into-multiple-field/m-p/54597#M15143</guid>
      <dc:creator>arpit</dc:creator>
      <dc:date>2011-04-21T10:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: convert a string into multiple field</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/convert-a-string-into-multiple-field/m-p/54598#M15144</link>
      <description>Would something like the following suffice?:&lt;BR /&gt;
&lt;BR /&gt;
data want (drop=i classes);&lt;BR /&gt;
  informat classes $30.;&lt;BR /&gt;
  array class(3) $10.;&lt;BR /&gt;
  input name $ classes &amp;amp;;&lt;BR /&gt;
  classes=compress(classes,'"');&lt;BR /&gt;
  do i=1 to 3;&lt;BR /&gt;
    class(i)=scan(classes,i);&lt;BR /&gt;
  end;&lt;BR /&gt;
  cards;&lt;BR /&gt;
ram "history,math geography" &lt;BR /&gt;
hari "physics,, math chemistry"&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
Art&lt;BR /&gt;
---------&lt;BR /&gt;
&amp;gt; I have a raw dat  like &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt;  ram  "history,math  geography"  &lt;BR /&gt;
&amp;gt; ari   "physics,, math chemistry"&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I want to create a data set like &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; history   math  geography&lt;BR /&gt;
&amp;gt; physics   math  chemistry&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Message was edited by: arpit</description>
      <pubDate>Thu, 21 Apr 2011 12:37:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/convert-a-string-into-multiple-field/m-p/54598#M15144</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-04-21T12:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: convert a string into multiple field</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/convert-a-string-into-multiple-field/m-p/54599#M15145</link>
      <description>How about this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data want(drop=row);&lt;BR /&gt;
 infile "c:\rawdata.txt" length=len;&lt;BR /&gt;
 input row $varying200. len;&lt;BR /&gt;
 want_row=compbl(translate(scan(row,2,'"'),' ',','));&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Fri, 22 Apr 2011 02:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/convert-a-string-into-multiple-field/m-p/54599#M15145</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-04-22T02:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: convert a string into multiple field</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/convert-a-string-into-multiple-field/m-p/54600#M15146</link>
      <description>data l;&lt;BR /&gt;
input name $ classes $40.;&lt;BR /&gt;
classes=compress(classes,'"');&lt;BR /&gt;
c1=scan(classes,1);&lt;BR /&gt;
c2=scan(classes,2);&lt;BR /&gt;
c3=scan(classes,3);&lt;BR /&gt;
cards;&lt;BR /&gt;
ram "history,math geography" &lt;BR /&gt;
hari "physics,, math chemistry"&lt;BR /&gt;
run;</description>
      <pubDate>Tue, 26 Apr 2011 14:37:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/convert-a-string-into-multiple-field/m-p/54600#M15146</guid>
      <dc:creator>R_Win</dc:creator>
      <dc:date>2011-04-26T14:37:25Z</dc:date>
    </item>
  </channel>
</rss>

