Prev: Proc Plan?
Next: different dates formats
From: Tom Abernathy on 16 Feb 2010 10:24 Dan - That doesn't make sense for a CSV file. A CSV file is just a list of values separated by commas. How can a value take up more than the cell that it is in? After you pull the CSV file into something like EXCEL you can reformat a value to span columns if you want. Perhaps you would prefer to output an Excel file? or some other format that allow formatting? - Tom On Feb 16, 9:28 am, deniseyu...(a)GMAIL.COM (SUBSCRIBE SAS-L Dan) wrote: > Thanks Mike. > > The code does the trick. However, the title appeared at first row and first > column. What I want is just one column in the first two rows, and it should > appear across the whole sheet, and I want the title to be centered at first > row. I guess that involves style statement, somehow. Do you have the way to > do that? > > Thanks again. > > Dan
From: Peter on 16 Feb 2010 05:01 On Feb 16, 2:41 am, deniseyu...(a)GMAIL.COM (SUBSCRIBE SAS-L Dan) wrote: > Hi. SASLers: > > How to out put a CSV file with a title, I also want to show variable's > label instead of variable's name? > > Also is there a good place to jump start on ODS outputs, espacially on > STYLE? I read the SAS 9.1 documents and found out they are overwhelming. > > Thanks. > > Dan Dan, for CSV handling through ODS markup see: http://support.sas.com/rnd/base/ods/odsmarkup/index.html PeterC
From: Mike Rhoads on 16 Feb 2010 10:40 So what you really want is a way to get your data into Excel? CSV and CSVALL can do that in a basic manner, but it won't let you get very fancy. It certainly won't let you merge cells in Excel, which is what it sounds like you are trying for. I'd recommend using the ExcelXP tagset. Note that you are fooling Excel by using an XLS file extension. You're not actually creating a binary XLS file, but rather an XML file in SpreadsheetML format, that can be opened by ExcelXP and later versions. In Office 2007, at least, you may get a message asking you to confirm you want to open the file, because it recognizes the deception. Just use something like: ods tagsets.excelxp file='c:\junk\Test.xls' options(embedded_titles='Yes') style=Minimal; .... ods tagsets.excelxp close; Mike Rhoads RhoadsM1(a)Westat.com -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L(a)LISTSERV.UGA.EDU] On Behalf Of SUBSCRIBE SAS-L Dan Sent: Tuesday, February 16, 2010 9:28 AM To: SAS-L(a)LISTSERV.UGA.EDU Subject: Re: ODS CSV Thanks Mike. The code does the trick. However, the title appeared at first row and first column. What I want is just one column in the first two rows, and it should appear across the whole sheet, and I want the title to be centered at first row. I guess that involves style statement, somehow. Do you have the way to do that? Thanks again. Dan
From: Mary on 16 Feb 2010 11:07 Dan, The trick to having the title span across columns is to include it in the column statement in Proc Report. But yes, as Mike says, you need to be using Excel Tagsets to get that kind of control over your output. Here is a complete example with a spanned column: ods listing close; ods tagsets.excelxp file= 'c:\temp\result_2009_01_18.xml' style=statistical options(default_column_width='20,20,10,10,10,10,10,10,10,10,10,10,10,10,10' sheet_label=' ' autofit_height="yes" ORIENTATION = 'landscape' center_horizontal = 'yes' center_vertical = 'no' PRINT_FOOTER = "run 01/18/2009"); ods tagsets.excelxp options(sheet_name="results"); title1 "Brandname use by Month"; title2 " "; proc report data=results nowindows; column ("Brand Name" brandname) ("Market Basket" result_n result_mean) ; define brandname/display "Brand Name " style(column)=[tagattr='format:#,##0' just=l] style(header)=[background=lightgrey Just=l]; define result_n/display "N" style(column)=[tagattr='format:#,##0' just=R] style(header)=[background=lightgrey Just=r]; define result_mean/display "Mean" style(column)=[tagattr='format:#,##0.0' just=R] style(header)=[background=lightgrey Just=r]; run; ods tagsets.excelxp close; ods listing; Note in the above example "Market Basket" would appear above the two columns result_n and result_mean. -Mary --- deniseyu001(a)GMAIL.COM wrote: From: SUBSCRIBE SAS-L Dan <deniseyu001(a)GMAIL.COM> To: SAS-L(a)LISTSERV.UGA.EDU Subject: Re: ODS CSV Date: Tue, 16 Feb 2010 09:28:21 -0500 Thanks Mike. The code does the trick. However, the title appeared at first row and first column. What I want is just one column in the first two rows, and it should appear across the whole sheet, and I want the title to be centered at first row. I guess that involves style statement, somehow. Do you have the way to do that? Thanks again. Dan
From: SUBSCRIBE SAS-L Dan on 16 Feb 2010 09:28
Thanks Mike. The code does the trick. However, the title appeared at first row and first column. What I want is just one column in the first two rows, and it should appear across the whole sheet, and I want the title to be centered at first row. I guess that involves style statement, somehow. Do you have the way to do that? Thanks again. Dan |