BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

I have several user specified macro parameters that I'd like to supply on the final report for documentation purposes. Some of fields have embedded single quotes so I can't default switch to single quotes easily.

Eg.

%let fiscal_year = "2014/15" "2013/14";

I'm struggling with how to pass this to my output, which is ODS Tagsets.ExcelXP.

Currently trying


ODS TEXT ="Years" &fiscal_year;

Any help appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

%let fiscal_year = "2014/15" "2013/14";

ods tagsets.excelxp file='C:\TEMP\text.xls'

  options( embedded_titles='yes' embedded_footnotes='yes' )

;

title1 %sysfunc(quote(Fiscal Year &fiscal_year));

proc print data=sashelp.class; run;

ods tagsets.excelxp close ;

View solution in original post

5 REPLIES 5
data_null__
Jade | Level 19
ODS TEXT = %sysfunc(quote(Years &fiscal_year));
JerryLeBreton
Pyrite | Level 9

Except I don't think ODS TEXT= is supported by  ExcelXP.

Maybe incorporate it into a TITLE.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

I agree, don't think ODS Text works for that tagset.  Titles also appear only in the print preview, so maybe not useful.

One suggestion I have is this.  The macro variables are stored in the SASHELP.VMACRO dataset.  Why not proc report this, putting a where clause on for the macro's you want to, then proc report your other data to the same sheet.  Hence two proc reports one sheet?

Reeza
Super User

Thanks all!

Tom and Data _null_'s solution work and the title is in the worksheet.

Tom
Super User Tom
Super User

%let fiscal_year = "2014/15" "2013/14";

ods tagsets.excelxp file='C:\TEMP\text.xls'

  options( embedded_titles='yes' embedded_footnotes='yes' )

;

title1 %sysfunc(quote(Fiscal Year &fiscal_year));

proc print data=sashelp.class; run;

ods tagsets.excelxp close ;

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
  • 5 replies
  • 997 views
  • 6 likes
  • 5 in conversation