DATA Step, Macro, Functions and more

How to read rtf files to sas dataset

Reply
Contributor
Posts: 60

How to read rtf files to sas dataset

Hi,

I was trying to read the rtf table output and i want to convert them in to sas dataset for the validation purpose.

Can anyone help me to read the rtf files in to sas.

Thanks in advance
Super Contributor
Super Contributor
Posts: 3,174

Re: How to read rtf files to sas dataset

I searched the SAS support http://support.sas.com/ website using Google advanced search argument:

read rtf file site:sas.com


and the SAS conference technical paper below discusses this topic:

Save Those Eyes: A Quality-Control Utility for Checking RTF Output Immediately
And Accurately
http://www2.sas.com/proceedings/sugi31/066-31.pdf


Scott Barry
SBBWorks, Inc.
Contributor
Posts: 60

Re: How to read rtf files to sas dataset

Hi Scott,

Thanks for the document i tried this document its working fine. but only for RTF specification type 1.6 version. There are many types of RTF Spec from 1.6 to 1.8.

I want to read any type of RTF file(Any versions).

Thanks in advance
Sudhakar
SAS Super FREQ
Posts: 8,743

Re: How to read rtf files to sas dataset

Hi:
Page 4 of the paper, which Scott referenced, outlines the macro program logic. For the places where the other RTF specifications differ from RTF 1.6, you would need to investigate those specifications and then alter your macro program accordingly.

I believe that ODS RTF creates RTF 1.6 output. I'm not sure whether TAGSETS.RTF also creates RTF 1.6 output; however you could check with Tech Support to be sure.

cynthia
Contributor
Posts: 60

Re: How to read rtf files to sas dataset

hi cynthia,

Thank you for the logic which you gave but i tried it before. It was some thing different from the earlier version. There are many difference between RTF version 1.6 and the other one.

FYI: SAS is generating RTF Version 1.6 files only.

If you can open the same RTF table output generated in SAS with windows 2003 and Windows XP. If you open that with NOTEPAD you can see a lot of difference between them. I need to learn entire RTF spec for 1.6, 1.8 and so on... for converting to SAS dataset. Its keep on changing.

Three factors which plays a role in creating the RTF files
1. SAS
2. Operating system ( even same opearting system with different service packs)
3. Microsoft Word installed in the System

I am looking for the consistent way of converting.

Anyway thanks for help.

Sudhakar
Contributor
Posts: 30

Re: How to read rtf files to sas dataset

Hi Sudharka

This paper describe a method I believe is more general. That is it should not matter
which versions or platforms.


http://www.lexjansen.com/phuse/2008/po/po03.pdf


Regards
Duong
www.tranz.co.uk
New Contributor
Posts: 3

Re: How to read rtf files to sas dataset

Hi Duong,

very interesting tool! Same question as Doc, where could I download the SAS macro %RTFParser?

Thanks, Florian
Trusted Advisor
Posts: 2,113

Re: How to read rtf files to sas dataset

Duong,

Where can we download %RTFParser . The paper makes it look like an interesting tool.

Doc Muhlbaier
Duke
Contributor
Posts: 44

Re: How to read rtf files to sas dataset

Dear all,

Now i am trying to solve this problem. please any one help me how to over come with this problem converting RTF file to SAS dataset. please give me a peace of code for this example. i grow through with all related articles but i dn't solution.

Study:XXXX Date: todaydate

Listing 10-3

Demographics

___________________________________________________________________________________

Subject/Age/Sex                             Treatment start

                                                        Date

____________________________________________________________________________________                             

0001-001/45/M                             19Jan2013

0001-002/55/M                             29Jan2013

0001-003/43/M                             12Jan2013

0001-004/42/M                             15Jan2013

0001-005/55/M                             29Jan2013

0001-006/35/M                             16Jan2013

                       

Note: All patients are shown.

Thanks in advance!!

With Regards,

Hima

Super User
Posts: 9,681

Re: How to read rtf files to sas dataset

Check @Arthur.T and @data _null_ 's paper :

http://support.sas.com/resources/papers/proceedings12/238-2012.pdf

Ask a Question
Discussion stats
  • 9 replies
  • 3406 views
  • 1 like
  • 8 in conversation