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

Hallo,

 

I do not have much experience in creating automatic reports in SAS. I experienced a problem while creating a report. I use ODS RTF and would like to set a bookmark by a macro variable. However, it does not work out.

 

The layout of the bookmark should be "2.1." with varying numbers indicated by a macro variable in the first position.

 

I assign a macro variable by

 

%macro compute;
    %global table;
    %let table=2;
%mend compute;
%compute;

 

and call a SAS code that creates the rtf-file.

 

The bookmark is set by

 

ods rtf bookmark = '&table..1';

 

The problem is that it is not allowed to use the &-sign in the bookmark statement.

(The anchor value "&table..13.14" is not valid for the "RTF" destination; anchors cannot contain white space, control characters, or any of the following: "()<>[]{}/%&\". Anchor value will be ignored.)

Thank you for your suggestions to solve that problem.

 

Best regards

Jens

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
JensK
Calcite | Level 5

Hallo

 

 

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hallo @JensK and welcome to the SAS Support Communities!

 

The issue is that macro variable reference &table is not resolved because of the single quotes surrounding it. (You've probably got a warning in the log: "Apparent symbolic reference TABLE not resolved.") If you use double quotes instead, &table will be resolved so that the compiler will see the value (2) stored in the macro variable rather than an invalid expression containing an ampersand.

ods rtf bookmark = "&table..1";
JensK
Calcite | Level 5

Hallo

 

 

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