Date: Thu, 20 Oct 2011 12:42:01 -0700
Reply-To: Mary Rosenbloom <mary.rosenbloom.sas@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mary Rosenbloom <mary.rosenbloom.sas@GMAIL.COM>
Subject: Re: ods tagsets ExcelXP on Unix How to get into Excel?
In-Reply-To: <COL108-W62444DCC02A67078078A29D9EB0@phx.gbl>
Content-Type: text/plain; charset=ISO-8859-1
Hi Shell Bell,
I don't have an answer to your question, but I couldn't resist showing you
this cool alternative to your code:
ods tagsets.ExcelXP options(sheet_interval='bygroup'
sheet_label=''
sheet_name='none');
title1 "Summary of Data";
title2 "#BYVAL(cohort) Cohort";
proc report data=dsn headline missing split='*' nowd
style(column)=data_center;
by cohort;
<code truncated here>
When you use a BY statement within PROC REPORT, you can use #BYVAL in
titles, and, if you are using ExcelXP, you can label the tabs based on the
values of your BY variable. If you want prefixes on them, you could say
SHEET_LABEL='Subject ' and that would put that as a prefix followed by the
value of the BY variable, and that would be the tab name.
Cheers,
Mary R.
On Thu, Oct 20, 2011 at 11:23 AM, Shell Bell <cherryhill@hotmail.com> wrote:
> I have the SAS add-in for excel. Working on Unix EG I wrote the following
to get one tab per name.
> I cannot open the excel directly, as it has to be written to Unix, but EG
has a results window that asks "Download Results?" Click download and
miraculously it comes opens into excel.
> Can I automate this or have some other method of getting it from the unix
to the NT side where excel lives?
>
> %macro seeit;
>
> proc sql noprint;
> select Name into: Name1-:Name20
> from sashelp.class;
> quit;
>
> ods tagsets.ExcelXP style=sasdocprinter file="~/agencydata/SeeClass1.xls";
> %do i= 1 %to 20;
>
> ods tagsets.ExcelXP
> options(sheet_name="See Class" width_fudge='1.0' ORIENTATION='LANDSCAPE'
);
>
> title'Class';
> title2"&datetime";
> proc print data=class noobs;
> where name="&&name&i";
> run;
> %end;
>
> ods tagsets.ExcelXP close;
>
> %mend seeit;
> %seeit;
>
> Thanks in advance,
> Shell Bell
|