SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

Create Exel file from dataset

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 14
Accepted Solution

Create Exel file from dataset

I was wondering if it's possible to create an excelfile with this on top in the sheet

&&B&i._Naam 2013-03.xls
Ontheffing Roerende Voorheffing - &&B&i._Naam
Datum Beslissing : 22/03/2013

followed with a dataset or if there is no data in the dataset  "nihil".

V1V2V3V4V5V6V7V8V9
dataset or nihil

Hope someone can help me.

Liej


Accepted Solutions
Solution
‎05-17-2013 07:01 AM
Respected Advisor
Posts: 4,137

Re: Create Exel file from dataset

If you want a macro variable to resolve you need to use double quotes instead of single quotes.

View solution in original post


All Replies
Contributor
Posts: 46

Re: Create Exel file from dataset

Hi. You can try with ods.tagset excel to have a customized excel

Occasional Contributor
Posts: 14

Re: Create Exel file from dataset

I'm trying the ods.tagset but I can't find a way to create such an excel.

Anyone who can help me?

Liej

Contributor
Posts: 46

Re: Create Exel file from dataset

I thin you can find the solution here..Just try with the options in excelxp

Check the below links for samples and training,

http://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html#toc

http://support.sas.com/resources/papers/proceedings12/276-2012.pdf

Thanks...

Occasional Contributor
Posts: 14

Re: Create Exel file from dataset

Thanks for the help.

This is my code and it works fine.

ODS Listing close;

ODS html3 body='/sas/prd/data/2013/Excel/CIT.xls' style=statdoc;     /*(1)*/

ODS noresults;

title c=brown bold "titel 1";

title2 "titel2";

title3 "title3";

data _null_;

set RVOut.CIT;

file print ODS=(Var=(a b c d e f));

put a b c d e f;

run;

ODS html3 close;

ODS listing;

ODS results;

BUT

(1)  ODS html3 body='&Excel' style=statdoc;    doesn't work

anyone who can help me to add the  '-sign before and after the &Excel variable?

Solution
‎05-17-2013 07:01 AM
Respected Advisor
Posts: 4,137

Re: Create Exel file from dataset

If you want a macro variable to resolve you need to use double quotes instead of single quotes.

Occasional Contributor
Posts: 14

Re: Create Exel file from dataset

I used this to add the '-signs

%let Excel= %str(%'&path/Excel/&&E&i._Excel%');

but then I get this error when using it in

ODS listing close;

ODS html3 body=&Excel;

ERROR 22-322: Syntax error, expecting one of the following: a name, a suoted string

Smiley Sad

Thanks Patrick.

%let Excel=&path/Excel/&&E&i._Excel;

ods html3 body="&Excel";

These two little changes made it work.

Thanks a lot.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 816 views
  • 6 likes
  • 3 in conversation