BookmarkSubscribeRSS Feed
jsbyxws
Obsidian | Level 7

Hello,  

 

I used the macro (http://pharma-sas.com/a-sas-macro-to-combine-portrait-and-landscape-rtf-files-into-one-single-file/) on one scenario and found the page number did not keep the original one. Instead pages is from 1 to N where N is the number of total pages of combined RTF file. The reason I suspect is that RTF code when opened in NotePad++ contains page information like this 

\fldinst { PAGE }}}{ of }{\field{\*\fldinst { NUMPAGES }}} .

And this is probably due to fact that RTF code "^{pageof}" in used in proc report in SAS program to create the RTF file.  

 

Can someone help?

2 REPLIES 2
Tom
Super User Tom
Super User

So what is your question?

Are you asking if there is RTF syntax that allows numbering to restart from 1 when you start a new section of the file?

That is probably a question you should ask on an RTF or Microsoft forum.

jsbyxws
Obsidian | Level 7

Thanks for asking!

 

For example, I want to combine two rtf files, each has 1 page. Each page is "1 of 1" with page number . But the combined rtf file has "1 of 2" and "2 of 2". This is NOT what I wanted. What I wanted is the original page: "1 of 1" and "1 of 1".

 

To create two rtf files with SAS, I use "^{pageof}", where "^" is escape character. See code below to create two dummy rtf files: RTF1.rtf and RTF2.rtf. 

jsbyxws_0-1663900670634.png

And RTF1.rtf is like below:

jsbyxws_2-1663901176005.png

 

 

The combined rtf file is like below for page 1. You can see page now is "1 of 2".

jsbyxws_1-1663900956324.png

 

 

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1174 views
  • 0 likes
  • 2 in conversation