BookmarkSubscribeRSS Feed
Saulius
Calcite | Level 5

According to SAS documentation http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000214615.htm user can manipulate with footer easily, i.e., set different options.

footnote color=red "Red," color=white "White, and" color=blue "Blue";

 

Using the same approach i want to enhance my footer with several alignment options: part of the text align left, other - center/right

(http://stackoverflow.com/questions/41183134/sas-footnote-issue-comparing-rtf-documents).  Files are generated (sample code in previous link), however if for safety reasons i compare such files (just make copy of the first one), i get msword error.

 

What is the cause of this msword problem: is it SAS related problem or MSword.

 

How to overcome the identified problem?

4 REPLIES 4
ballardw
Super User

Without the error message it would be hard to tell.

It isn't quite clear exactly what you may be doing. It sounds like you use SAS with the ODS RTF destination to create and RTF file, then open in Word and then do a save as to create a copy. Is that correct?

Saulius
Calcite | Level 5

The error message says:

This error message may be the result of a corrupt table in the current document. (sometimes this message pops out during comparison/trying to change footer properties in comparison screen).

 

In the code provided in http://pastebin.com/1cm5v25r there are two 2 different/similar footers: same lines, different order. Using the provided code You can generate 2 different RTF files. Then make copies (ctrl +c/+v) of these files and try comparing with the original files (use std msword compare functionality).

 

Comparing files where the last footer line combines two different text alignments gives error message (top of this message).

 

Hope now it is clear.

ballardw
Super User

Any number of things possible, mostly related to Microsoft. If you EDIT something in Word then the codes placed are not necessarily the ones that SAS generates using RTF because Microsoft has tons of stuff. I would basically not use the Microsoft compare for something like this because you know they have changed.

When you do the edit did you turn on the very limited 'reveal codes' functionality in Word? You edit may get placed in the wrong place in relation to other features, hence the "corrupted table".

If you haven't played with low level file contents and Microsoft. Generate a VERY Small document from SAS with your footer. Then do the edit as you describe. Make sure the files are both RTF. Open them in a plain text editor such as NOTEPAD, not something that supports RTF appearance enhancements.

 

You may find that the editted file has a vast number of added MSformat codes inserted. And the way that the footnote gets editted, which SAS does create as a very simplistic table, has lots of code that unless you spend lots of time with the RTF specifications you won't recognize.

 

One option may be to use escapechar and the RAW instruction to insert RTF codes directly into SAS generated text. I have had hit-and-miss luck with getting the result I want and haven't tried this with footnotes.

Another option may be to use ODS tagsets.rtf which has a few differences for whether text is always in a table or not. May, no promises.

Saulius
Calcite | Level 5

Dear  ,

 

have you checked the code i added to my post(s)? I have used the same approach as you mention: try with small example. The result i got to was described: >1 alignment in last footer line is problematic.

 

Using comparison - notepad/diff and other stuff - this is not the case, as i'm aiming for the text changes and MSword compare allows this functionality (comparing "source" of rtf you suggest is not the option).

 

First, i'm not sure if the formating approach i consider in my footers is correct. If yes, either SAS/MSword has error. If no, ideas how footer should be processed are welcome (.sas part).

 

Edited:

FOOTNOTE1 "~{style [textdecoration=underline]Switching from underline to}

~{style [textdecoration=line_through]line-through, then}

~{style [textdecoration=overline]overline}."; - such formating works, however when i switch to text alignment/justification no formating is applied

FOOTNOTE1 "~{style [textalign=left]Switching from underline to}

~{style [textalign=center]line-through, then}

~{style [textalign=right]overline}.";

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
  • 4 replies
  • 898 views
  • 0 likes
  • 2 in conversation