The SAS Output Delivery System and reporting techniques

Generating excel using Proc report.

Reply
N/A
Posts: 1

Generating excel using Proc report.

Hi,

I have to generate the excel report in the below format. Kindly help me on this.

Col Header 1 Col Header 2 Month
Jan Feb ..............................Dec
Row header1 Tbl_col
Row header2 Tbl_col
Tbl_col
Row header3 Tbl_col
Tbl_col
Row header4 Row header5


As in the above format we need to fill data every month the program runs.
Ex:- The report in 2010 will only have 3 months listed once December is here. Then in 2011, the only month on the report will be January, then when it is February month end January and February will be listed.

Kindly assist on this!

RajaReddy
Super Contributor
Super Contributor
Posts: 3,174

Re: Generating excel using Proc report.

Posted in reply to RajaReddy
Investigate using the SAS DATA step approach which gives you maximum flexibility with generating your own desired formatted output.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

data step programming create csv file site:sas.com

data step programming intro site:sas.com
SAS Super FREQ
Posts: 8,868

Re: Generating excel using Proc report.

Posted in reply to RajaReddy
Hi:
Although PROC REPORT could generate your report, when ODS creates a result file -- it creates the WHOLE file -- so using ODS and PROC REPORT, you could not "add" just a column for February to an existing Excel sheet that already contains data for January.

So using the ODS approach, in January, you would create a report that showed only January; then in February, you would overwrite the Excel file with a report that showed January and February; then in March, you would create a report that showed January, February and March. However, the report would not be "additive" -- it would be recreated in its entirety every month. If this approach is not what you had in mind, then Scott's suggestion to look at DATA step techniques is the way to go.

cynthia
Ask a Question
Discussion stats
  • 2 replies
  • 136 views
  • 0 likes
  • 3 in conversation