BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi all,

I supposed have to generate the Report for 15 countries in one workbook. Each country should be in one work-sheet.
write no m using
Example:
DATA _NULL_;
now=today();
ldate=now-30;
CALL SYMPUT("MDATE",PUT(ldate,monname8.));
CALL SYMPUT("YDATE",PUT(ldate,year4.));
CALL SYMPUT("dDATE",PUT(today(),WORDDATE18.));
RUN;

title1 "&title - ESO SUMMARY" italic height=16pt;
footnote1 'Analytics' justify=right;
footnote2 "&ddate" justify=right;

ods html file=" c:\path " style=statdoc;

%rpt;(Report generation for countries through Macro)

ods html close;
ods _all_ close;
ods listing;
2 REPLIES 2
Olivier
Pyrite | Level 9
Hi.

If you have SAS 9 and Excel 2003 or higher, you can build XML files using ODS TAGSETS.EXCELXP ; this will give you the opportunity to use options like SHEET_INTERVAL=BYGROUP, and adding a BY country ; statement in your report program will automatically create a different worksheet for each country, no matter how many they are.
Details & documentation can be found on :
http://support.sas.com/rnd/base/topics/odsmarkup/
http://support.sas.com/rnd/papers/sugi29/ExcelXML.pdf
and the syntax can be displayed in your log running code like :
ODS TAGSETS.EXCELXP OPTIONS(DOC="HELP") FILE = "c:\temp\nothing.xls" ;
ODS TAGSETS.EXCELXP CLOSE ;

Cheers.
Olivier
deleted_user
Not applicable
For ExcelXP-related programming, you can use my program:

http://sas2themax.com/blogs/owner/archive/2007/02/04/SAS_2D00_to_2D00_Excel-via-XML-by-DelGobbo_2C00...

A detailed how-to article is posted here:

http://sas2themax.com/blogs/owner/archive/2007/02/11/How-to-export-your-SAS-data-as-a-multi_2D00_she...

You can set, edit, save, and reuse your ExcelXP options -- no need for an *.ini file, macros, or any other external files.

I'd be happy to entertain any questions regarding the program.

Regards, Audi

E-mail: audi@sas2themax.com

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
  • 630 views
  • 0 likes
  • 2 in conversation