BookmarkSubscribeRSS Feed
thanikondharish
Calcite | Level 5

ods rtf file='path' ;

proc report data=sashelp.class nowd ;

run;

ods rtf close ;

in above program to send the data(report) from sas to particular path .

 

how to get that data from path to sas?

7 REPLIES 7
PGStats
Opal | Level 21

So many ways to read data from "path",

 

  • use a datastep with the infile statement.
  • define a libname from which you read your table
  • use proc import
  • use the Import Data menu item in the SAS window

The best method dépends on the nature (format) of your data source.

PG
error_prone
Barite | Level 11
It has been requested many times: post what you have, show example data and what you need as result.

Do you have an rtf-file? Reading rtf is hardly possible, because the file format is not meant to be used as input, but only as output.

Do you want to read the data, that will be source of the porch report you posted?
Astounding
PROC Star

The standard tool for the job is PROC PRINTTO.  Before PROC REPORT, add:

 

proc printto print=path;

run;

 

After PROC REPORT, add:

 

proc printto;

run;

 

If you intend to use the same path for many reports, you need to read the details within PROC PRINTTO ... when does it replace the original file, and when does it append to the original file.

Reeza
Super User

@thanikondharish Please spend some more time elaborating on your questions. It's hard to understand them and you're not providing enough information at the outset, though we ask constantly. Here's a good primer, and it's mostly in your best interest because you get faster answers and higher quality answers, rather than a lot of back and forth asking for clarifications. 

 

https://stackoverflow.com/help/how-to-ask

 

Regarding your question, replace the word path with the path of your choice and the file will be there, provided you have the correct permissions. 

 

ballardw
Super User

@thanikondharish wrote:

ods rtf file='path' ;

proc report data=sashelp.class nowd ;

run;

ods rtf close ;

in above program to send the data(report) from sas to particular path .

 

how to get that data from path to sas?


It is a very good idea when referencing any external location to start from a known specific root location such as:

ods rtf file='c:\foldername\otherfolder' ;

proc report data=sashelp.class nowd ;
run;

ods rtf close ;

Which starts at a known drive on a Windoze system. If you do not specify a starting point the default location is relative to the SAS current directory which may be in a system program folder where you do not have permissions, especially likely in a SAS server environment.

 

But ODS, Output Delivery System, is for OUTPUT and has nothing to do with reading data. Filename statements are used to point to files to read. And RTF is NOT going to be good source in general. If you don't believe me, open and RTF file in Notepad, the SAS editor or other program that does plain text reading (not Word or Wordpad which render the RTF control codes).

thanikondharish
Calcite | Level 5
i can't understand this code
ballardw
Super User

@thanikondharish wrote:
i can't understand this code

When you do not clearly state the problem or what you are attempting to accomplish solution code is next to impossible.

 

The code I posted was to demonstrate placing a starting point for a path that SAS can use to find sub-folders or directories.

 

Also ODS does not have anything to do with reading data. So I cannot tell why you included that.

Are you attempting to read data or create output? Not clear from your text and the code shows nothing attempting to read so I don't understand what "get data" means in this context.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 7 replies
  • 912 views
  • 0 likes
  • 6 in conversation