<?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: report of data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/report-of-data/m-p/311216#M67203</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input year     month   item   $       price;
cards;
 2008        1       bread        1.00
 2008         2      bread        1.02
 2008        3      bread         1.03
   2008      1       Eggs          1.40
   2008      2      Eggs           1.45
   2008      3      Eggs           1.33
   ;
run;


proc sort data=have;by year item;run;
proc transpose data=have out=want;
by year item;
id month;
var price;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 13 Nov 2016 04:24:40 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-11-13T04:24:40Z</dc:date>
    <item>
      <title>report of data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/report-of-data/m-p/311212#M67199</link>
      <description>&lt;P&gt;I have a small issue with my code :I am trying to create a data set that has&lt;BR /&gt;1)&lt;STRONG&gt;12 variables corresponding to each month&lt;/STRONG&gt;,&lt;BR /&gt;2) that contain the &lt;STRONG&gt;price data for each combination of item and year.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;my short&amp;nbsp;datalines are&lt;BR /&gt;&amp;nbsp;year &amp;nbsp; &amp;nbsp; month &amp;nbsp; item &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;price&lt;BR /&gt;&amp;nbsp;2008 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; bread &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.00&lt;BR /&gt;&amp;nbsp;2008 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 &amp;nbsp; &amp;nbsp; &amp;nbsp;bread &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.02&lt;BR /&gt;&amp;nbsp;2008 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp;bread &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.03&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;2008 &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; Eggs &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.40&lt;BR /&gt;&amp;nbsp; &amp;nbsp;2008 &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp;Eggs &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.45&lt;BR /&gt;&amp;nbsp; &amp;nbsp;2008 &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp;Eggs &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.33&lt;/P&gt;
&lt;P&gt;and so on for next five years 2009,2010,2011,2012 with 12 months and having milk as third item and have different prices for each month and each year,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;my code is&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data aveprices_latest;
	set sasdata.have;

proc sort data=aveprices_latest;
	byitem;
run;

proc means data=aveprices_latest;
	class year;
	by item;
	var price;
run;

proc tabulate data=aveprices_latest;
	class item Year Month;
	var price;
	table item*Year, Month*Price;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;My output is showing &lt;STRONG&gt;data table of averages&lt;/STRONG&gt;, whereas I want the &lt;STRONG&gt;price data&lt;/STRONG&gt; -n&lt;U&gt;ot sums of the price data&lt;/U&gt;.&lt;BR /&gt;I want to change the structure of the data table to make it have &lt;U&gt;&lt;STRONG&gt;one column of data for each month.showing the combination of items and year.&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;Can you advise which part of my code need change?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Nov 2016 04:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/report-of-data/m-p/311212#M67199</guid>
      <dc:creator>afs</dc:creator>
      <dc:date>2016-11-13T04:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: report of data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/report-of-data/m-p/311216#M67203</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input year     month   item   $       price;
cards;
 2008        1       bread        1.00
 2008         2      bread        1.02
 2008        3      bread         1.03
   2008      1       Eggs          1.40
   2008      2      Eggs           1.45
   2008      3      Eggs           1.33
   ;
run;


proc sort data=have;by year item;run;
proc transpose data=have out=want;
by year item;
id month;
var price;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 13 Nov 2016 04:24:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/report-of-data/m-p/311216#M67203</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-13T04:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: report of data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/report-of-data/m-p/311222#M67206</link>
      <description>I am getting the variables as col1 col2 col3 col4 for the months , can i change it to Jan feb March april and so on , moreover the list of variables is&lt;BR /&gt;year item -Name- _Lable- Col1 Col 2 Col 3 -----&lt;BR /&gt;under the _Name getting all obs as price and under Lable getting Average price ...Can we delete price and average price obs and just make a title as Average price .</description>
      <pubDate>Sun, 13 Nov 2016 05:40:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/report-of-data/m-p/311222#M67206</guid>
      <dc:creator>afs</dc:creator>
      <dc:date>2016-11-13T05:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: report of data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/report-of-data/m-p/311283#M67237</link>
      <description>Dear Ksharp-I am getting the variables as col1 col2 col3 col4 for the months , can i change it to Jan feb March april and so on , moreover the list of variables is&lt;BR /&gt;year item -Name- _Lable- Col1 Col 2 Col 3 -----&lt;BR /&gt;under the _Name getting all obs as price and under Lable getting Average price ...Can we delete price and average price obs and just make a title of the table as Average prices</description>
      <pubDate>Sun, 13 Nov 2016 21:38:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/report-of-data/m-p/311283#M67237</guid>
      <dc:creator>afs</dc:creator>
      <dc:date>2016-11-13T21:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: report of data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/report-of-data/m-p/311304#M67243</link>
      <description>&lt;PRE&gt;
I don't understand your second question.



data have;
input year     month   item   $       price;
cards;
 2008        1       bread        1.00
 2008         2      bread        1.02
 2008        3      bread         1.03
   2008      1       Eggs          1.40
   2008      2      Eggs           1.45
   2008      3      Eggs           1.33
   ;
run;
proc format;
value fmt
 1='Jan'
 2='Feb'
 3='Mar';
run;

proc sort data=have;by year item;run;
proc transpose data=have out=want(drop=_name_ _label_);
by year item;
id month;
format month fmt.;
var price;
run;

&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Nov 2016 03:02:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/report-of-data/m-p/311304#M67243</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-14T03:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: report of data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/report-of-data/m-p/311305#M67244</link>
      <description>Thanks.. It worked....</description>
      <pubDate>Mon, 14 Nov 2016 03:05:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/report-of-data/m-p/311305#M67244</guid>
      <dc:creator>afs</dc:creator>
      <dc:date>2016-11-14T03:05:23Z</dc:date>
    </item>
  </channel>
</rss>

