BookmarkSubscribeRSS Feed
Ross
Calcite | Level 5
Hello-

I've recently upgraded to 9.2 from 9.13 and am in the process of updating my in-line formatting code. Using ODS PDF, previously it was possible to mark a place for the line to wrap to - the function was 'm' in the prior version. I use this mostly in footnotes to control the wrapping. I'm also wanting to use it in a ODS text= string. I can't find what that function is in the version 9.2. It is not mentioned in any of the 9.2 in-line documentation that I could find.

Briefly, here is how I used it in 9.13:
ODS escapechar="~";
ODS PDF ....;
Proc Report .....statements

footnote1 font=arial italic bold height=9pt j=c "Notes: " font=arial italic height=8pt "~mThis is a very long footnote that I want to wrap under the word 'this'.";

Is there a similar function in the 9.2 update to in-line formatting?

Thanks!

Ross
8 REPLIES 8
Cynthia_sas
SAS Super FREQ
Hi:
You might want to check with Tech Support. It was my understanding that line marking and line wrapping with ODS ESCAPECHAR might not go forward into newer versions of SAS. I don't know whether attributes like leftmargin= or indent= will work to do what you want.

If there is a workaround for the marking and wrapping, Tech Support will know.

cynthia
Ross
Calcite | Level 5
Okay. I actually tried the leftmargin nested but it didn't work. I was thinking that I may be able to get similar results by using newline and nbspace and just forcing it to happen but there would be some trial and error involved getting it to work each time.

After further review, I just checked another 9.13 program and it appears that the old in-line syntax and functions were applied as intended when I ran it in 9.2. I didn't think the previous syntax would even work but it looks like it does. Is it appropriate to pick and choose the in-line syntax? It will help with the transition to 9.2 since we won't have to find and change all of the in-line formatting first.
Cynthia_sas
SAS Super FREQ
Yes, the older syntax -mostly- works in 9.2. And it is appropriate to pick and choose. There were some capabilities that just did not translate as well to the new "function" style syntax for ODS ESCAPECHAR.

So if the older syntax works, you could still choose to use it. There will be no enhancements to that older syntax in future versions of SAS, however.

cynthia
ballardw
Super User
The NEWLINE function may be something to investigate for this use as well.
KarlK
Fluorite | Level 6
PMFJI, but escapechar-m still works in 9.2. I have, for example, this type of statement (where ods escapechar='^'):

ods pdf text = "^{style [fontweight=bold]Notes: }^mThis line will wrap to ""this"" (more text here to make this line wrap)";

"Notes:" is bolded, and the line wraps to the ^m.

As Cynthia said, I'd remain skeptical about using this for production work, but for now, at least, it still works.

Karl
KarlK
Fluorite | Level 6
Cynthia's comment about possible lack of future support made me a little nervous. I think I found another, albeit slightly less flexible, way to do this (called a "hanging indent"). The key is that the textindent attribute can take a NEGATIVE value. So you need to decide how far you want every line but the first to be indented, set your left margin to that amount, and then "undent" the first line by the same amount.

In pdf, which is the only destination I've tested this on, here's an example:

ods pdf text = "^{style [leftmargin=0.43in textindent=-0.43in]^{style [fontweight=bold]Notes: }This line will wrap to the word ""This"" (more text here to make this line wrap, more text here to make this line wrap, more text here to make this line wrap)}";

The nested style just bolds "Notes:". I figured out by trial and error that it takes up about 0.43 inches. I then move the left margin 0.43 inches to the right, and then indent the 1st line 0.43 inches TO THE LEFT by using a negative value. Slick, no?

Karl
Cynthia_sas
SAS Super FREQ
Hi, Karl:
Great job figuring that out! You're right that it is different. If you wanted to indent under "Supercalifragilisticexpealidocious", for example (instead of Notes), your numbers would need to change -- but your method is the "new" approach.

cynthia
Ross
Calcite | Level 5
Thanks Karl - that would work in most instances. I think I also saw reference to "hangingindent" in the documentation somewhere but haven't had time to experiment with it. There are instances where I do need the marking like when you have one note and then want to start the next one a line down. Before it was ~n or Newline in the new syntax. I guess in the same vein, a bunch of non-breaking spaces could be inserted before and then use the indent.

And thanks Cynthia.

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