<?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: breaking a data set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/breaking-a-data-set/m-p/248193#M46605</link>
    <description>&lt;P&gt;I am not sure what you want exactly. How your table looks is another issue and can be done by different ways.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example you can use PROC REPORT&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=have SPANROWS ;
column code price;
define code / order 'Groups';
define price/ display 'Price';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 05 Feb 2016 08:57:11 GMT</pubDate>
    <dc:creator>mohamed_zaki</dc:creator>
    <dc:date>2016-02-05T08:57:11Z</dc:date>
    <item>
      <title>breaking a data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/breaking-a-data-set/m-p/247104#M46292</link>
      <description>&lt;P&gt;I am having a car sales data file. Wanted to berak the data set where it can give me groups on price ranges.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Having price ranges between 1 to 50 . Want to create 4 groups of data 1-10, 10-20,20-30 and so on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to do this via simple code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jan 2016 10:12:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/breaking-a-data-set/m-p/247104#M46292</guid>
      <dc:creator>BhavukZutshi</dc:creator>
      <dc:date>2016-01-31T10:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: breaking a data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/breaking-a-data-set/m-p/247105#M46293</link>
      <description>&lt;P&gt;You can use PROC FORMAT&lt;/P&gt;
&lt;P&gt;like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value rangefmt 
1 -&amp;lt;10 = '01-10'
10 -&amp;lt; 20 = '10-20'
20 -&amp;lt; 30 = '20-30'
30 -&amp;lt; 40 = '30-40'
40 - 50 = '40-50'
;

data want;
set have;
code=put(price, rangefmt.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or you can use noraml IF/ELSE statments&lt;/P&gt;
&lt;P&gt;like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data want;
set have;
if 1 &amp;lt;= price &amp;lt; 10 then code='01-10';
else if 10 &amp;lt;= price &amp;lt; 20 then code='10-20';
else if 20 &amp;lt;= price &amp;lt; 30 then code='20-30';
else if 30 &amp;lt;= price &amp;lt; 40 then code='30-40';
else if 40 &amp;lt;= price &amp;lt;= 50 then code='40-50';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 31 Jan 2016 12:23:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/breaking-a-data-set/m-p/247105#M46293</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-01-31T12:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: breaking a data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/breaking-a-data-set/m-p/248169#M46592</link>
      <description>&lt;P&gt;The above solution stands good but what actually I'm looking for is to realign the whole table on basis of price where if price is less than 10 then that entire set should group as one set , then another set on price range of 10-20 and so on. The above solution just creates another column named as code and assign each row a vlaue on identification of price.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 06:34:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/breaking-a-data-set/m-p/248169#M46592</guid>
      <dc:creator>BhavukZutshi</dc:creator>
      <dc:date>2016-02-05T06:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: breaking a data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/breaking-a-data-set/m-p/248193#M46605</link>
      <description>&lt;P&gt;I am not sure what you want exactly. How your table looks is another issue and can be done by different ways.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example you can use PROC REPORT&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=have SPANROWS ;
column code price;
define code / order 'Groups';
define price/ display 'Price';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Feb 2016 08:57:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/breaking-a-data-set/m-p/248193#M46605</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-02-05T08:57:11Z</dc:date>
    </item>
  </channel>
</rss>

