<?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: Transposing 2 columns into multiple rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Transposing-2-columns-into-multiple-rows/m-p/501005#M133521</link>
    <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
  input COL1 $16.;
  cards;
notes
name A1
code B1
..
notes
name A2
code B2
;
run;
data WANT;
  set HAVE;
  length NAME CODE  $8;
  retain NAME;
  if COL1=:'name' then NAME=substr(COL1,6);
  if COL1=:'code' then do ;
    CODE=substr(COL1,6);
    output;
    call missing(NAME, CODE);
  end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Oct 2018 01:33:00 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2018-10-03T01:33:00Z</dc:date>
    <item>
      <title>Transposing 2 columns into multiple rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-2-columns-into-multiple-rows/m-p/500986#M133507</link>
      <description>&lt;P&gt;I have a one column data which contains information about multiple observations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each observation starts with a first column value of&amp;nbsp; "notes".&lt;/P&gt;&lt;P&gt;I.E.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;notes&lt;/P&gt;&lt;P&gt;name&amp;nbsp; A1&lt;/P&gt;&lt;P&gt;code&amp;nbsp; &amp;nbsp;B1&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;notes&lt;/P&gt;&lt;P&gt;name A2&lt;/P&gt;&lt;P&gt;code&amp;nbsp; B2&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;notes&lt;/P&gt;&lt;P&gt;name A200&lt;/P&gt;&lt;P&gt;code&amp;nbsp; B200&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a good way to transpose this into 200 rows?&lt;/P&gt;&lt;P&gt;PS. I would like to have name, code, ..., as my column variables after transposing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 22:32:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-2-columns-into-multiple-rows/m-p/500986#M133507</guid>
      <dc:creator>suhwan</dc:creator>
      <dc:date>2018-10-02T22:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing 2 columns into multiple rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-2-columns-into-multiple-rows/m-p/501005#M133521</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
  input COL1 $16.;
  cards;
notes
name A1
code B1
..
notes
name A2
code B2
;
run;
data WANT;
  set HAVE;
  length NAME CODE  $8;
  retain NAME;
  if COL1=:'name' then NAME=substr(COL1,6);
  if COL1=:'code' then do ;
    CODE=substr(COL1,6);
    output;
    call missing(NAME, CODE);
  end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 01:33:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-2-columns-into-multiple-rows/m-p/501005#M133521</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-03T01:33:00Z</dc:date>
    </item>
  </channel>
</rss>

