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

Hi there,

I'm trying to modify the rtf tagset (I want to add a header and footer in the rtf document and seen here http://www.phuse.eu/download.aspx?type=cms&docID=4197 that this could be done somehow).

So, my problem begins already by copying the tagset to a new tagset (WITHOUT ANY MODIFYING!). I tried it this way

proc template;

     define tagset Tagsets.rtf_test;

       parent = tagsets.rtf; 

     end;

run;

and I tried copying the rtf tagset code and modify the define statement like this:


proc template;

define tagset Tagsets.Rtf_test;

... tagset code ...

end;

run;

After submitting the proc template, I can see the new tagset in my SASUSER.TEMPLAT storage in the Tagsets folder as rtf_test and all seemed to work well.

But, when I call the new tagset like this:

ods tagsets.rtf_test file="&gFilenameListings" uniform pagepanels=none style=ReportStyle.ReportStyle options(contents='yes' toc_data='yes' sect='off' toc_level='1');

%include "&gProgListings\Listing.sas";

ods tagsets.rtf_test close;

The rtf which is created contains only the rtf control words and also not all data which should be in.

The content of the rtf file is:

{\fonttbl

}

{\colortbl;

}

{\*\bkmkstart IDX}{\*\bkmkend IDX}

{\plain\f1\b0\i0\tc\v Listing 1 Demographics  \tcf67 \tcl1 }

\trowd\trkeep\trhdr\trql\trgaph0

{\row}

\trowd\trkeep\trhdr\trql\trgaph0

{\row}

\trowd\trkeep\trql\trgaph0

\pard\plain\intbl\fs3\cf#000000\ql\b\tqdec\tx3{294\cell}

\pard\plain\intbl\fs3\cf#000000\qr\b\tqdec\tx8{ 8\cell}

\pard\plain\intbl\fs3\cf#000000\qr\b\tqdec\tx8{13\cell}

\pard\plain\intbl\fs3\cf#000000\qr\b\tqdec\tx8{ 12\cell}

\pard\plain\intbl\fs3\cf#000000\qr\b\tqdec\tx8{Female \cell}

\pard\plain\intbl\fs3\cf#000000\qr\b\tqdec\tx8{170\cell}

\pard\plain\intbl\fs3\cf#000000\qr\b\tqdec\tx8{ 80.0\cell}

\pard\plain\intbl\fs3\cf#000000\qr\b\tqdec\tx8{28\cell}

\pard\plain\intbl\fs3\cf#000000\qr\b\tqdec\tx11{not working\cell}

\pard\plain\intbl\fs3\cf#000000\qr\b\tqdec\tx13{Skin type II \cell}

{\row}

\trowd\trkeep\trql\trgaph0

{\row}

\sectd\linex0\endnhere

\pard\par\par\plain{\field\fldedit{\*\fldinst { TOC \tcf67 \\h }}}

\sect\sectd\linex0\endnhere\pgnrestart\pgnstarts1

{\header\pard\plain\qr\pvmrg\phmrg\posxr\posy0{

}}

{\pard\par}

{\*\bkmkstart IDX1}{\*\bkmkend IDX1}

{\plain\f1\b0\i0\tc\v Listing 2 Visit Dates  \tcf67 \tcl1 }

\trowd\trkeep\trhdr\trql\trgaph0

{\row}

\trowd\trkeep\trhdr\trql\trgaph0

{\row}

\trowd\trkeep\trql\trgaph0

\pard\plain\intbl\fs3\cf#000000\ql\b\tqdec\tx3{294\cell}

\pard\plain\intbl\fs3\cf#000000\ql\b\tqdec\tx11{16-APR-2010\cell}

\pard\plain\intbl\fs3\cf#000000\ql\b\tqdec\tx11{28-MAY-2010\cell}

\pard\plain\intbl\fs3\cf#000000\ql\b\tqdec\tx11{09-JUL-2010\cell}

\pard\plain\intbl\fs3\cf#000000\ql\b\tqdec\tx11{09-OCT-2010\cell}

\pard\plain\intbl\fs3\cf#000000\ql\b\tqdec\tx11{13-MAY-2011\cell}

{\row}

\trowd\trkeep\trql\trgaph0

{\row}

}

When I creatrt e my listing with tagsets.rtf and save the created rtf file as xml then I see that there is much more rtf control syntax in it.

What am I doing wrong? I hope anybody could help me, because I don't understand this behaviour...

Thanks in advance,

Daniela

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  See the information about the RTF_SAMPLE tagset template in this forum posting:

https://communities.sas.com/message/146321#146321

cynthia

View solution in original post

5 REPLIES 5
Cynthia_sas
SAS Super FREQ

Hi:

Seeing the generated RTF is not as helpful as seeing any error messages in your log. So many different things could be impacting your program. Just because you can see the template in SASUSER does not mean that the proper ODS PATH has been issued so that ODS can USE the template. Since you downloaded this based on a PhUSE paper, did the paper author mention any warnings or things that needed to be done? Are you using EG? Is SAS on a server? It is possible that the server does not have visibility of your SASUSER library where the template is stored? Are  you using the BI Platform?

So many things could be impacting this...I think your best bet for help is to open a track with Tech Support. They can investigate everything that is going on with your template build, your ODS path, your server and point you in the right direction.

cynthia

BlackTea
Calcite | Level 5

Hi,

just for information: I made a SAS support entry and they could reproduce this behaviour, but do not know in which SAS maintenance release this bug will be solved...I don't understand though why this seems to work for the guy who wrote the presentation I have found (see my first post).

I'm using SAS 9.3 M0

Cynthia_sas
SAS Super FREQ

Hi:

  Possibly you could contact the paper author and see whether he would share his code with you. It looks to me like he added extensive sub-options to his version of tagsets.rtf to give him more control over the headers. And, in looking at his slide presentation, he's passing in a lot of RTF control strings (and it's not a trivial task to understand what the correct RTF control strings are).

  When you write a tagset template, you are writing instruction for how to create ALL of those RTF control strings -- that means you have to know what all of them mean and when and how they should get issued.

  The presentation author gave his email address. Have you tried to contact him to ask whether he would share his code?

cynthia

Cynthia_sas
SAS Super FREQ

Hi:

  See the information about the RTF_SAMPLE tagset template in this forum posting:

https://communities.sas.com/message/146321#146321

cynthia

BlackTea
Calcite | Level 5

Hi Cynthia,

many thanks four your hint!

In the meantime the SAS Support got me this technical note:

45138 - Creating an RTF file using a modified version of TAGSETS.RTF generates an RTF file without a...

which lists the bug due to which I cannot create my own tagset in the common way.

If I go for the described workaround it works fine and I am able to modify the tagset for the title and footnote inclusion.

But with the rtf_sample tagset it is not necessary any more! I don't know why this tagset thing is so unpopular. It really cuts down the working time for the creation of listings for a whole database!

Daniela

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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