BookmarkSubscribeRSS Feed
RajaReddy
Calcite | Level 5
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
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
Cynthia_sas
SAS Super FREQ
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 639 views
  • 0 likes
  • 3 in conversation