The SAS Output Delivery System and reporting techniques

PROC SQL from "file"?

Reply
N/A
Posts: 1

PROC SQL from "file"?

Is there a way to directly hit a file thru a proc sql or do I have to first create a data set.

Example

DATA tbs_tmp;
set '/home/xxx/xxx/tbs'
RUN;

then PROC SQL from tbs_temp


or.. is there a way to directly hit the file?

PROC SQL;
CREATE TABLE tbs AS
SELECT * FROM '/home/xxx/xxx/tbs' WHERE etc ORDER BY etc

?? Thanks!
SAS Super FREQ
Posts: 8,743

Re: PROC SQL from "file"?

Hi:
This is not an ODS or Base SAS Reporting procedure (PRINT, REPORT, TABULATE) question.

Proc SQL will NOT read "flat" files directly. So for example, if you have the file /home/xxx/xxx/tbs.txt , then that would be considered an ASCII text file and it is unlikely that PROC SQL would read it. However, IF you had an Oracle table and you used the SAS/Access product for Oracle, then it would be possible for Proc SQL to read the Oracle table. Since you did not show a file extension for your hypothetical file, it is nearly impossible to make any comment about how you might approach a solution. Generally, however, you access "flat files" with an INFILE statement (and then an INPUT statement), not a SET statement in a DATA step program. Then, once the "flat file" has been converted to SAS format, then you could use PROC SQL to accomplish further tasks or perform other reporting.

Your best bet for help is to contact Tech Support. To send a question to Tech Support, go to http://support.sas.com/ and in the left-hand navigation pane, click on the link entitled "Submit a Problem".

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 114 views
  • 0 likes
  • 2 in conversation