<?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 Getting a single row of data from several in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Getting-a-single-row-of-data-from-several/m-p/43055#M11225</link>
    <description>Say I have the following dataset:&lt;BR /&gt;
ID	ASSET	ORIGIN&lt;BR /&gt;
1	100	1&lt;BR /&gt;
1	100	8&lt;BR /&gt;
1	200	1&lt;BR /&gt;
1	200	8&lt;BR /&gt;
1	302	2&lt;BR /&gt;
2	100	1&lt;BR /&gt;
2	100	8&lt;BR /&gt;
2	200	1&lt;BR /&gt;
2	200	8&lt;BR /&gt;
2	302	2&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
where ASSET= 100 is Equity, 200 is Fixed Incomes, &lt;BR /&gt;
and ORIGIN= 1 is domestic, 2 is foreign and 8 is global&lt;BR /&gt;
&lt;BR /&gt;
I want to create a portfolio snapshot for each ID (variable values= 1 or 0) so that the final dataset looks as below:&lt;BR /&gt;
&lt;BR /&gt;
ID	EQUITY	DOMEQUITY	FOREQUITY	GLOEQUITY	FIXED	DOMFIXED	FORFIXED	GLOFIXED&lt;BR /&gt;
1	1	1	0	1	1	1	0	1&lt;BR /&gt;
2	1	1	0	1	1	1	0	0&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Though I have shown an identical portfolio for the two IDs, it is generally different for different individuals. I have about 23 asset classes and over 72,000 observations. Another thing is that the IDs are not continuous numbers. So I have IDs that go 1,2,6,14 etc.&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions? I have been struggling with this.</description>
    <pubDate>Wed, 10 Jun 2009 12:29:10 GMT</pubDate>
    <dc:creator>spg</dc:creator>
    <dc:date>2009-06-10T12:29:10Z</dc:date>
    <item>
      <title>Getting a single row of data from several</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-a-single-row-of-data-from-several/m-p/43055#M11225</link>
      <description>Say I have the following dataset:&lt;BR /&gt;
ID	ASSET	ORIGIN&lt;BR /&gt;
1	100	1&lt;BR /&gt;
1	100	8&lt;BR /&gt;
1	200	1&lt;BR /&gt;
1	200	8&lt;BR /&gt;
1	302	2&lt;BR /&gt;
2	100	1&lt;BR /&gt;
2	100	8&lt;BR /&gt;
2	200	1&lt;BR /&gt;
2	200	8&lt;BR /&gt;
2	302	2&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
where ASSET= 100 is Equity, 200 is Fixed Incomes, &lt;BR /&gt;
and ORIGIN= 1 is domestic, 2 is foreign and 8 is global&lt;BR /&gt;
&lt;BR /&gt;
I want to create a portfolio snapshot for each ID (variable values= 1 or 0) so that the final dataset looks as below:&lt;BR /&gt;
&lt;BR /&gt;
ID	EQUITY	DOMEQUITY	FOREQUITY	GLOEQUITY	FIXED	DOMFIXED	FORFIXED	GLOFIXED&lt;BR /&gt;
1	1	1	0	1	1	1	0	1&lt;BR /&gt;
2	1	1	0	1	1	1	0	0&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Though I have shown an identical portfolio for the two IDs, it is generally different for different individuals. I have about 23 asset classes and over 72,000 observations. Another thing is that the IDs are not continuous numbers. So I have IDs that go 1,2,6,14 etc.&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions? I have been struggling with this.</description>
      <pubDate>Wed, 10 Jun 2009 12:29:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-a-single-row-of-data-from-several/m-p/43055#M11225</guid>
      <dc:creator>spg</dc:creator>
      <dc:date>2009-06-10T12:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a single row of data from several</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-a-single-row-of-data-from-several/m-p/43056#M11226</link>
      <description>SAS PROC TRANSPOSE can address this data transposing (vertical to horizontal) requirement.  Have a look at the SAS documentation and also there are technical/conference papers on the topic at the SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 10 Jun 2009 12:38:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-a-single-row-of-data-from-several/m-p/43056#M11226</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-06-10T12:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a single row of data from several</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-a-single-row-of-data-from-several/m-p/43057#M11227</link>
      <description>Thanks Scott! I'll try what you suggested.</description>
      <pubDate>Thu, 11 Jun 2009 01:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-a-single-row-of-data-from-several/m-p/43057#M11227</guid>
      <dc:creator>spg</dc:creator>
      <dc:date>2009-06-11T01:59:47Z</dc:date>
    </item>
  </channel>
</rss>

