Date: Fri, 8 Apr 2011 10:29:20 -0500
Reply-To: Yu Zhang <zhangyu05@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Yu Zhang <zhangyu05@GMAIL.COM>
Subject: Re: Proc Report, Across, style(column) tagattr
In-Reply-To: <SNT122-W1002033DEBB0EACD32061EDA70@phx.gbl>
Content-Type: text/plain; charset=ISO-8859-1
Hi,Sudo Ku,
I just run your code and it runs well. not sure what you mean "not right".
Are you using the most recent tagset definition? I include the following
code before run your sample code.
ods path work.tmplmst(update) sashelp.tmplmst(read);
filename tagset url '
http://support.sas.com/rnd/base/ods/odsmarkup/excltags.tpl';
%include tagset;
I also added an option "noprint" in define dummy statement to suppress that
column.
can you elaborate more on "something is still not quite right"?
Yu
On Fri, Apr 8, 2011 at 7:41 AM, Sudo Ku <crafty876@hotmail.com> wrote:
> Hi Yu and _Null_:
>
> Something is still not quite right, and I'm pretty sure I have just
> interpreted what you have told me to do incorrectly. I've setup a small data
> set (2 years instead of 5) and my full proc report. Can you ahve a look and
> see where I am going wrong?
>
> Data repacro;
> Input GRAIN_CODE $ crop_yr tonnes t_tonnes;
> cards;
> 01 2009.5 14183155.34 14183.16
> 02 2009.5 3567762.49 3567.76
> 03 2009.5 887725.76 887.73
> 04 2009.5 1376983.23 1376.98
> 05 2009.5 95701.22 95.70
> 06 2009.5 624984.33 624.98
> 07 2009.5 7112464.20 7112.46
> 12 2009.5 1193112.66 1193.11
> 13 2009.5 1585955.93 1585.96
> 14 2009.5 32510.69 32.51
> 99 2009.5 298096.98 298.10
> WF 2009.5 207564.00 207.56
> 01 2008.5 14112710.46 14112.71
> 02 2008.5 3602597.53 3602.60
> 03 2008.5 1509461.29 1509.46
> 04 2008.5 1490769.29 1490.77
> 05 2008.5 29050.00 29.05
> 06 2008.5 530190.21 530.19
> 07 2008.5 7841990.83 7841.99
> 12 2008.5 1236096.40 1236.10
> 13 2008.5 1876073.21 1876.07
> 14 2008.5 146377.57 146.38
> 99 2008.5 103845.75 103.85
> WF 2008.5 191267.00 191.27
> ;
> run;
>
> proc format; value $tab1_grain_e '01'='Wheat' '02'='Durum Wheat'
> '03'='Oats' '04'='Barley' '05'='Rye'
> '06'='Flaxseed' '07'='Canola' '12'='Soybean' '13'='Peas' '14'='Corn'
> 'WF'='Wheat Flour' '99'='Others'
> 'ZZ'='Total';
> value crop_yr 2005.5='2005-2006' 2006.5='2006-2007' 2007.5='2007-2008'
> 2008.5='2008-2009' 2009.5='2009-2010';
> ods TAGSETS.EXCELXP file="C:\temp\Report Across Example.&sysdate .xls"
> STYLE=Minimal;
> ODS Tagsets.excelxp options(Sheet_interval="None" sheet_name="Table 1"
> orientation="Landscape" center_horizontal='YES'
> absolute_column_Width="15,15,10,10,10,10,10" autofit_height="YES"
> zoom="100" fittopage="Yes" Embedded_titles="yes" embedded_footnotes="yes");
>
> proc report data=repacro nowindows ;
>
> title1 ' '; title2 "Table 1. Total grain and wheat flour exports (metric
> tonnes)";
>
> Columns grain_code (crop_yr, tonnes) dummy;
> define grain_code / group " " format=$tab1_grain_e. order=data;
> define crop_yr / across " " Format=crop_yr. order=data;
> define tonnes / analysis Sum format=comma13. " ";
> define dummy / computed " ";
>
> /*This does not quite work I get an extra column filled with nulls and
> no change to my 2009, 2008 data*/
> compute dummy;
> array temp(2:3) _C2_ _C3_;
> do i=2 to 3;
> call define (i,"style","style=[tagattr='type:Number Format:#,##0']");
> end;
> endcomp;
>
> compute Grain_Code;
> if _break_ = '_RBREAK_' then
> Grain_code="ZZ";
> endcomp ;
> RBreak after / SUMMARIZE;
> run; title1; title2;
> ODS tagsets.excelxp close;
>
>
> I hope my email comes to the listserv a little bit clearer this time, I've
> set my hotmail encoding to plain text.
>
> Thanks Again,
>
> Kevin
>
>
> ----------------------------------------
> > Date: Thu, 7 Apr 2011 17:05:05 -0500
> > From: zhangyu05@GMAIL.COM
> > Subject: Re: Proc Report, Across, style(column) tagattr
> > To: SAS-L@LISTSERV.UGA.EDU
> >
> > You are Mr. _null_. I am sorry for the wrong code. I copied and pasted
> from
> > the code i was using. in original code, the variables can be specified as
> an
> > enumerated list. i modified the code without thinking carefully.
> >
> > Again, sorry about that.
> >
> > Yu
> >
> >
> > On Thu, Apr 7, 2011 at 4:31 PM, Data _null_; wrote:
> >
> > > On Thu, Apr 7, 2011 at 3:58 PM, Data _null_; wrote:
> > > > You can specify a enumerated list _C2_ - _C6_ because the number have
> > > > to come at the end.
> > >
> > > Translation:
> > >
> > > You can't specify an enumerated list as _C2_ - _C6_ because the
> > > numbers must come at the end for an enumerated list.
> > >
>
|