The SAS Output Delivery System and reporting techniques

Generating excel using Proc report.

Not applicable
Posts: 1

Generating excel using Proc report.


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
Row header3 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!

Super Contributor
Super Contributor
Posts: 3,176

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

data step programming intro
Posts: 9,365

Re: Generating excel using Proc report.

Posted in reply to RajaReddy
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.

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation