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

Hi,

 

Say there are two ODS destinations open, and I run three proc prints.

I want the first one to go to the HTML and RTF documents, the second one to go to the HTML document only, and the third one to the RTF document only.

Is there a way to do this?

 

PS

The reason this needs to to done is that the (same) data contains HTML formatting in one case (like <br>), and RTF formatting for the other case (like \line).

Maybe there is a better way than embedding these formatting words (and use style protectspecialchars=off ) in otherwise identical data?

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

For HTML or HTML5, you could use the NO_BOTTOM_MATTER and NO_TOP_MATTER options, plus FILENAME with append options, to "pause" and "continue" output to an HTML destination.

 

And then there is SELECT and EXCLUDE options on these ODS destinations, to selectively decide what to output where.

 

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

View solution in original post

7 REPLIES 7
Ksharp
Super User
Not sure if this could work.

ods html file=.........
ods rtf file=.....
proc print.....

ods html close;
proc print;

ods html ;
ods rtf close;
proc print;
ChrisHemedinger
Community Manager

For HTML or HTML5, you could use the NO_BOTTOM_MATTER and NO_TOP_MATTER options, plus FILENAME with append options, to "pause" and "continue" output to an HTML destination.

 

And then there is SELECT and EXCLUDE options on these ODS destinations, to selectively decide what to output where.

 

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
ChrisNZ
Tourmaline | Level 20

Thanks Chris

I thought SELECT was only to manage documents.

Adding lines such as

ods rtf select ALL;
ods html exclude ALL;

seems to do the trick!

ChrisNZ
Tourmaline | Level 20

@Cynthia_sas Your paper contains this table

image.png

Is there a somewhat comprehensive list of the various customisation options, at least for the first three categories?

Cynthia_sas
SAS Super FREQ
Hi:
That paper was showcasing the older style ^S of ODS ESCAPECHAR. The ability to do inline-formatting went through some changes in SAS 9.2 and at the end of my paper, I showed some comparisons between the original syntax and the newer ^{style...} syntax.
Line breaks and non-breaking spaces still work although with slightly different syntax. Line wraps went away. Regarding a "comprehensive list" styles and functions (like dagger and page x of y), you should look in the documentation. This web site: https://go.documentation.sas.com/?docsetId=odsug&docsetTarget=p11xia2ltavr8ln17srq8vn4rnqc.htm&docse... has a lovely list of all the functions in the current implementation of ODS ESCAPECHAR. And in addition to DAGGER, which was one of the original functions, there's the wonderful new UNICODE function, as well as BOLD and ITALIC, which simplify how you get bold and italic in text.

For the style attributes that you specify when you use STYLE with ODS ESCAPECHAR, you have to refer to this documentation table: https://go.documentation.sas.com/?docsetId=odsug&docsetTarget=n0otdo2g12obp3n0zmnghcn7p4vu.htm&docse... and in general understand how style attributes would in general before you start using them in ODS ESCAPECHAR.

Hope this helps,
Cynthia

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 7 replies
  • 626 views
  • 2 likes
  • 5 in conversation