<?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 transposing data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/transposing-data/m-p/8426#M316</link>
    <description>Hi,&lt;BR /&gt;
 I have a data in this format:&lt;BR /&gt;
Id         Question           text&lt;BR /&gt;
1              c1                xx&lt;BR /&gt;
1              c3                aa&lt;BR /&gt;
1              h9                bb &lt;BR /&gt;
1              h20              cc&lt;BR /&gt;
&lt;BR /&gt;
I would like to get output in this format&lt;BR /&gt;
&lt;BR /&gt;
id        questInd       textInd        questocc   textocc&lt;BR /&gt;
1             c1              xx                c3            aa&lt;BR /&gt;
1              h9             bb                 h20           cc&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I want to pair C1 with C3 and H9 with H20. But I don't want to hardcode anything, because the quest pair can change. (It could be c4 and C5 or b11 and b14) etc.&lt;BR /&gt;
Is there a way I can accomplish this. I tried using first. last. and macro variables and array, but I am not able to get correct output.&lt;BR /&gt;
&lt;BR /&gt;
thank you.</description>
    <pubDate>Tue, 01 Apr 2008 19:40:07 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-04-01T19:40:07Z</dc:date>
    <item>
      <title>transposing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/transposing-data/m-p/8426#M316</link>
      <description>Hi,&lt;BR /&gt;
 I have a data in this format:&lt;BR /&gt;
Id         Question           text&lt;BR /&gt;
1              c1                xx&lt;BR /&gt;
1              c3                aa&lt;BR /&gt;
1              h9                bb &lt;BR /&gt;
1              h20              cc&lt;BR /&gt;
&lt;BR /&gt;
I would like to get output in this format&lt;BR /&gt;
&lt;BR /&gt;
id        questInd       textInd        questocc   textocc&lt;BR /&gt;
1             c1              xx                c3            aa&lt;BR /&gt;
1              h9             bb                 h20           cc&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I want to pair C1 with C3 and H9 with H20. But I don't want to hardcode anything, because the quest pair can change. (It could be c4 and C5 or b11 and b14) etc.&lt;BR /&gt;
Is there a way I can accomplish this. I tried using first. last. and macro variables and array, but I am not able to get correct output.&lt;BR /&gt;
&lt;BR /&gt;
thank you.</description>
      <pubDate>Tue, 01 Apr 2008 19:40:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/transposing-data/m-p/8426#M316</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-04-01T19:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: transposing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/transposing-data/m-p/8427#M317</link>
      <description>For you to automate the reformating/reconfiguring of any set of data, there has to be recognizable controlling pattern.&lt;BR /&gt;
&lt;BR /&gt;
So, in your case, what is the pattern?&lt;BR /&gt;
Is it that the first (odd) observations are "ind" and the second (even) observations are "occ"?&lt;BR /&gt;
&lt;BR /&gt;
If so, then there are two ways to deal with the situation:&lt;BR /&gt;
1) random access of the dataset through dataset options.&lt;BR /&gt;
2) use of the Lag() function.</description>
      <pubDate>Tue, 01 Apr 2008 20:14:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/transposing-data/m-p/8427#M317</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-04-01T20:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: transposing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/transposing-data/m-p/8428#M318</link>
      <description>thanks Chuck. You were right in that I had to come up with some pattern to identify the pairs. I accoplished this through the macro variables and the do loop.</description>
      <pubDate>Wed, 02 Apr 2008 15:26:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/transposing-data/m-p/8428#M318</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-04-02T15:26:11Z</dc:date>
    </item>
  </channel>
</rss>

