<?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 Creating new smaller dataset from a larger one in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42948#M362</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for this neat reply. This would work if my weeks were unique for each product.&lt;/P&gt;&lt;P&gt;But since it's a panel data, the same weeks recur for different stores. I'll try to see how&lt;/P&gt;&lt;P&gt;I can use the proc transpose.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Nov 2011 16:11:20 GMT</pubDate>
    <dc:creator>Moein</dc:creator>
    <dc:date>2011-11-08T16:11:20Z</dc:date>
    <item>
      <title>Creating new smaller dataset from a larger one</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42945#M359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a large panel data set of weekly product prices for a number of products. &lt;/P&gt;&lt;P&gt;Now I need to take the large column of&lt;/P&gt;&lt;P&gt;prices and puts the prices of each product in one new column in a&lt;/P&gt;&lt;P&gt;new data set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to go from:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Product A&amp;nbsp;&amp;nbsp;&amp;nbsp; aPrice1&lt;/P&gt;&lt;P&gt;Product A&amp;nbsp;&amp;nbsp;&amp;nbsp; aPrice2&lt;/P&gt;&lt;P&gt;Product A&amp;nbsp;&amp;nbsp;&amp;nbsp; aPrice3&lt;/P&gt;&lt;P&gt;Product A&amp;nbsp;&amp;nbsp;&amp;nbsp; aPrice4&lt;/P&gt;&lt;P&gt;Product A&amp;nbsp;&amp;nbsp;&amp;nbsp; aPrice5&lt;/P&gt;&lt;P&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp; bPrice1&lt;/P&gt;&lt;P&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp; bPrice2&lt;/P&gt;&lt;P&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp; bPrice3&lt;/P&gt;&lt;P&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp; bPrice4&lt;/P&gt;&lt;P&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp; bPrice5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aPrice1&amp;nbsp; bPrice1&lt;/P&gt;&lt;P&gt;aPrice2&amp;nbsp; bPrice2&lt;/P&gt;&lt;P&gt;aPrice3&amp;nbsp; bPrice3&lt;/P&gt;&lt;P&gt;aPrice4&amp;nbsp; bPrice4&lt;/P&gt;&lt;P&gt;aPrice5&amp;nbsp; bPrice5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone please help me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Moe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 00:41:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42945#M359</guid>
      <dc:creator>Moein</dc:creator>
      <dc:date>2011-11-08T00:41:17Z</dc:date>
    </item>
    <item>
      <title>Creating new smaller dataset from a larger one</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42946#M360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sounds like you need to use PROC TRANSPOSE. In your data, do you have a variable indicating week number? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; product $ &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;-&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;9&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&amp;nbsp; price $ week $;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;datalines&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product A&amp;nbsp;&amp;nbsp;&amp;nbsp; aPrice1 201101&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product A&amp;nbsp;&amp;nbsp;&amp;nbsp; aPrice2 201102&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product A&amp;nbsp;&amp;nbsp;&amp;nbsp; aPrice3 201103&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product A&amp;nbsp;&amp;nbsp;&amp;nbsp; aPrice4 201104&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product A&amp;nbsp;&amp;nbsp;&amp;nbsp; aPrice5 201105&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp; bPrice1 201101&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp; bPrice2 201102&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp; bPrice3 201103&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp; bPrice4 201104&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp; bPrice5 201105&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;sort&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;=test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; week;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;transpose&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;=test &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;=test_transposed (drop=_name_);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; week;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; product;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; price;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 09:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42946#M360</guid>
      <dc:creator>ieva</dc:creator>
      <dc:date>2011-11-08T09:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new smaller dataset from a larger one</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42947#M361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is your price column containing a price id, or is the price itself?&lt;/P&gt;&lt;P&gt;If it is an id, and it is built using a naming convention as in your example, you could accomplish this by joining the table with itself. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;﻿﻿﻿﻿proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select test_a.price as price_a,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test_b.price as price_b&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from test as test_a,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test as test_b&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where substr(test_a.price,2) = substr(test_b.price,2) and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(test_a,1,1) = 'a' and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(test_b,1,1) = 'b'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 11:56:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42947#M361</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2011-11-08T11:56:51Z</dc:date>
    </item>
    <item>
      <title>Creating new smaller dataset from a larger one</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42948#M362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for this neat reply. This would work if my weeks were unique for each product.&lt;/P&gt;&lt;P&gt;But since it's a panel data, the same weeks recur for different stores. I'll try to see how&lt;/P&gt;&lt;P&gt;I can use the proc transpose.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 16:11:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42948#M362</guid>
      <dc:creator>Moein</dc:creator>
      <dc:date>2011-11-08T16:11:20Z</dc:date>
    </item>
    <item>
      <title>Creating new smaller dataset from a larger one</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42949#M363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for this answer. My data has numbers and I was using&lt;/P&gt;&lt;P&gt;letters to show the manipulation i needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 16:12:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42949#M363</guid>
      <dc:creator>Moein</dc:creator>
      <dc:date>2011-11-08T16:12:38Z</dc:date>
    </item>
    <item>
      <title>Creating new smaller dataset from a larger one</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42950#M364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; product $ &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;-&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;9&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&amp;nbsp; price $ ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;num=substr(price,length(price),&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;datalines&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product A&amp;nbsp;&amp;nbsp;&amp;nbsp; aPrice1 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product A&amp;nbsp;&amp;nbsp;&amp;nbsp; aPrice2 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product A&amp;nbsp;&amp;nbsp;&amp;nbsp; aPrice3 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product A&amp;nbsp;&amp;nbsp;&amp;nbsp; aPrice4 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product A&amp;nbsp;&amp;nbsp;&amp;nbsp; aPrice5 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp; bPrice1 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp; bPrice2 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp; bPrice3 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp; bPrice4 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp; bPrice5 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;sort&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; num;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;transpose&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;=have &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;=want (drop=_name_ num);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; num;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; product;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; price;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 21:18:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42950#M364</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2011-11-08T21:18:12Z</dc:date>
    </item>
    <item>
      <title>Creating new smaller dataset from a larger one</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42951#M365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you could give us some more near real world sample data we might give you some better suggestions...&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Linus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 21:35:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42951#M365</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2011-11-08T21:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new smaller dataset from a larger one</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42952#M366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why did you pair aPrice1 with bPrice1 instead of some other value of the price for product B? &lt;/P&gt;&lt;P&gt;Are there not ID variables in the data that you could use to merge?&lt;/P&gt;&lt;P&gt;If there are no ID variables then you might get what you want using a merge WITHOUT a by statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; merge have(where=(var1='Product A') keep=var1 var2 rename=(var2=Aprice))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; have(where=(var1='Product B') keep=var1 var2 rename=(var2=Bprice))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;* NO by statement ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop var1 ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 23:16:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42952#M366</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-11-08T23:16:57Z</dc:date>
    </item>
    <item>
      <title>Creating new smaller dataset from a larger one</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42953#M367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As you correctly thought, there are no unique ID variables. Your answer neatly does the trick. Thank you. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 03:17:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Creating-new-smaller-dataset-from-a-larger-one/m-p/42953#M367</guid>
      <dc:creator>Moein</dc:creator>
      <dc:date>2011-11-09T03:17:01Z</dc:date>
    </item>
  </channel>
</rss>

