Reputation: 4570
Application: SAS Enterprise Guide 4.3 / Operating System: Windows XP
I am trying to learn the SAS programming language and am having trouble reading in a small, space-delimited text file which contains tabular data. When I execute the following syntax:
data demographic;
infile "C:\Documents and Settings\USERID\My Documents\sas\mydata.txt" dlm=" ";
input Gender$ Age Height Weight; run;
I receive the following error message in the log:
ERROR: Physical file does not exist, /sas/config/Lev1/FORApp/C:\Documents and Settings\USERID\My Documents\sas\mydata.txt.
I know that I can load the text file in through the GUI, but would really like to know how to load data from the command line.
Any help provided is greatly appreciated.
Upvotes: 2
Views: 7371
Reputation: 21
It sounds like you're using a SAS SODA configuration. In which case, for reasons known but to God, it appears you can't directly address local files without using the data import wizard or stuff of similar ilk. Frankly, this is a royal pain.
Upvotes: 2
Reputation: 21
Add "File" and "Import Data" steps to your process flow to transfer the file to your SAS server. From there, you can export the data as a step in the project and read it into your program step.
Upvotes: 2
Reputation: 28411
In EG, use the File/Import Data option to upload your data to the server. You can save this task in your EG project if you want the data to reside in the WORK lib during usage...or you can change the output data location in the Import wizard to store the data permanently on the server.
Upvotes: 1
Reputation: 2174
Your SAS code is executed on a SAS server. It can only read files accessible from that server. If you have access to the server, upload it and use that location in the infile statement.
If you don't have access to the server, there is no other way than uploading it using the EG GUI.
Upvotes: 3