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

 

Hi experts,

 I have 3 x.rtf, y.rtf, z.rtf in path. I would like to merge them to make a single document.

For this i'm referring to the directory where all the .rtf files present by a libname statement and later i have planned to use them in proc document as written below.

 

it throws error as in the proc document step extension(.rtf) cant read by sas.

 

libname docs "path mentioned here";

ods rtf file="new_path\combined_document.rtf";
proc document name= docs.x.rtf;
replay;
run;
quit;
proc document name=docs.y.rtf;
replay;
run;
quit;

proc document name=docs.z.rtf;
replay;
run;
quit;
ods _all_ close;

 

Kindly suggest how to resolve this or any other way by which i can take the existing .rtf documents and combine them by some way please do suggest. It would be helpful if someone can help me know how to refer a rtf file present in a directory.

1 ACCEPTED SOLUTION

Accepted Solutions
sahoositaram555
Pyrite | Level 9
Thanks ballardw, andreas_lds for your inputs. I have found another way to solve this.

View solution in original post

3 REPLIES 3
andreas_lds
Jade | Level 19

I don't think that you can access rtf-files through a library, at least not with any engine i have ever seen. So you might have to re-think the process, i am sure that better tools exist to merge rtf-files than using sas-code.

ballardw
Super User

Proc Document processes SAS output, not RTF files, for restructuring.

 

Combining existing RTF files is a Word processor task generally. Or at least not a SAS process.

sahoositaram555
Pyrite | Level 9
Thanks ballardw, andreas_lds for your inputs. I have found another way to solve this.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1516 views
  • 0 likes
  • 3 in conversation