Date: Thu, 27 Oct 2005 16:10:47 -0400
Reply-To: Ed Heaton <EdHeaton@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ed Heaton <EdHeaton@WESTAT.COM>
Subject: Re: Proc Export to Excel Column Widths
Content-Type: text/plain; charset="US-ASCII"
Bill,
/* Simply connect to Excel with a LIBNAME statement. */
LibName xlsLib '\\dir\file&sysdate..xls' ;
/* Now, you need to make sure you don't already have a
worksheet (actually a named range) called Piece. */
Proc sql ;
Drop table xlsLib.Piece ;
Quit ;
/* Now, use PROC COPY or anything you like to write the
file to Excel. */
Proc copy in=work out=xlsLib ;
Select Piece ;
Run ;
/* Now, clear your libref. */
LibName xlsLib clear ;
Ed
Edward Heaton, SAS Senior Systems Analyst,
Westat (An Employee-Owned Research Corporation),
1600 Research Boulevard, RW-4541, Rockville, MD 20850-3195
Voice: (301) 610-4818 Fax: (301) 294-3879
mailto:EdHeaton@Westat.com http://www.Westat.com
-----Original Message-----
From: bill_droogendyk@dofasco.ca [mailto:bill_droogendyk@dofasco.ca]
Sent: Thursday, October 27, 2005 4:02 PM
To: Ed Heaton
Subject: RE: Proc Export to Excel Column Widths
Ed;
yes, we do
I'm interested ...
Thanks,
Bill
Bill,
Do you have SAS/ACCESS to PC Files licensed? If so, I have a nice
solution.
Ed
Edward Heaton, SAS Senior Systems Analyst,
Westat (An Employee-Owned Research Corporation),
1600 Research Boulevard, RW-4541, Rockville, MD 20850-3195
Voice: (301) 610-4818 Fax: (301) 294-3879
mailto:EdHeaton@Westat.com http://www.Westat.com
-----Original Message-----
From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu]
On Behalf Of bill_droogendyk@dofasco.ca
Sent: Thursday, October 27, 2005 10:37 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Proc Export to Excel Column Widths
Folks;
I've a SAS data set that I'd like to export to xl. I use proc export
and find that a couple of the columns do not have the complete content
in xl, i.e. truncated.
Values such as 77 W677 (char $2 and char $4) show up in excel as 7
and W or blank. I suppose that it has something to do with xl
eyeballing what the value should be. How do I force it to read/accept
the entire value.
SAS v9.1.3 on win2000
PROC EXPORT DATA= WORK.piece
OUTFILE= "\\dir\file&sysdate..xls"
DBMS=EXCEL2000 REPLACE;
SHEET="Piece";
RUN;
Thank you!
Bill