BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Amine_Khemiri
Obsidian | Level 7

I would like to combine 100 rtf files in one rtf file using SAS studio.

Thanks for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
Amine_Khemiri
Obsidian | Level 7

Dear All,

 

Please note that I found a macros that is combining multiple rtf file in one single rtf file and it works very well.

 

https://www.bioinfo-scrounger.com/archives/combine_rtf/?fbclid=IwAR0i-lugw5FT-w_nOcTbEfJ5lh6qpBLf0HW...

 

Thanks.

 

Kind regards,

Amine

 

 

View solution in original post

6 REPLIES 6
A_Kh
Lapis Lazuli | Level 10

Are you creating those 100 rtf files in sas? If yes, then what is your code to create those files? 

Amine_Khemiri
Obsidian | Level 7
Yes, I have different SAS codes that create 100 rtf files. Now, I want a code to combine all 100 files into 1 single rtf file.
ballardw
Super User

Not really a SAS job to combine already existing files.

If you created them from SAS then the proper way is to create ONE file instead of 100s. Easy to do in theory: wrap all of the output creating steps that write to the RTF in single ODS RTF call:

 

Dummy code:

Ods rtf file="<path>\bigfile.rtf" <other rtf options>;

<first proc step that creates output>
<second proc step that creates output>
<repeat until last proc step that creates output>

ods rtf close;

Or create the output and use Proc document to gather all the output together for the rtf output.

 

If you have "different sas codes" you could use %include to call separate SAS files but you would want to remove the specific ods rtf output/close in any of them to use the above approach.

A_Kh
Lapis Lazuli | Level 10

In this case, you should put all your codes inside a single ODS RTF sandwich as suggested in previous comments.  See additional comments here

Amine_Khemiri
Obsidian | Level 7

Dear All,

 

Please note that I found a macros that is combining multiple rtf file in one single rtf file and it works very well.

 

https://www.bioinfo-scrounger.com/archives/combine_rtf/?fbclid=IwAR0i-lugw5FT-w_nOcTbEfJ5lh6qpBLf0HW...

 

Thanks.

 

Kind regards,

Amine

 

 

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