Desktop productivity for business analysts and programmers

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

Reply
Occasional Contributor
Posts: 8

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

I copy and paste the path of my saved file...

ERROR: Physical file does not exist, C:\Documents and Settings\Iris\Desktop\SAS\SAS Basic

       Concepts\SASIntro\PracticeFiles\pilot.dat.

data sasuser._pilotdata1;

     infile 'C:\Documents and Settings\Iris\Desktop\SAS\SAS Basic Concepts\SASIntro\PracticeFiles\pilot.dat';

     input EmployeeID $ 1-6

             FirstName $ 7-19

             LastName $ 20-34

             JobCode $ 35-41

             Salary 42-47

             Category $ 48-50;

run;

Can't move on with my class right now because of this...Thanks a lot!

Iris.

Esteemed Advisor
Posts: 7,300

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

Did you copy and paste the entire path .. including the filename and extension?  I would bet that one of those (filename and/or extension) are wrong.

Your syntax is correct.

Esteemed Advisor
Posts: 7,300

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

I just noticed that you had posted this in the EG Forum.  SAS EG can't access data from your local drive.  The way to move it from your local drive, to the SAS server, is described at: http://support.sas.com/ondemand/learn_eg.html

Occasional Contributor
Posts: 8

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

but the data that we can upload are only sas data set, but isn't this function trying to convert a raw data set from somewhere in the computer to a sas data file?

Thanks for the help,

Iris.

Esteemed Advisor
Posts: 7,300

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

You didn't read enough of the document from that link:

Working with Data Other than SAS Data Sets

If you want to work with data other than SAS data sets (such as comma delimited files or text files), you can import the files in to SAS®OnDemand for Academics: Enterprise Guide. To import non SAS data, follow these steps:

  1. Select File --> Import Data.
  2. Select Local Computer.
  3. Find and select the data file that you want to use.
Occasional Contributor
Posts: 8

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

oh, now I know how to upload the data into my library. But now it shows another error by using the same codes...

ERROR: Physical file does not exist, C:\SAS\Config\Lev1\SASApp\pilot.data.

Esteemed Advisor
Posts: 7,300

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

Did you change your extension from dat to data or was that a typo?

Occasional Contributor
Posts: 8

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

typo.sorry.

Occasional Contributor
Posts: 8

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

and I also tried to add the files according to the C:\SAS\Config\Lev1\SASApp path, but it still didn't work.

Esteemed Advisor
Posts: 7,300

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

Did you get it to work?  Are you using OnDemand for Academics: Enterprise Guide?  If you are, according to that same document, the paths where the data are located on the server all appear to begin with '\  .. not a drive name.

Occasional Contributor
Posts: 8

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

I'm using SAS Enterprise Guide 4.3. And I still can't get it to work...

Esteemed Advisor
Posts: 7,300

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

I'm not familiar with EG, so I'll have to leave it to someone else to help you out.  Just out of curiosity, when you loaded the file, did it give you a directory name of where it stored the file?  It might be hidden in a log.

Occasional Contributor
Posts: 8

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

yes, I created my library already before I do this, and I store the file under my library.

and the can't locate file is the only error in the log...

Thanks for your helps though.

Iris.

Esteemed Advisor
Posts: 7,300

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

FWIW, I just followed the steps in the instructions I provided earlier and EG created a SAS file from the text file and placed it in the SASUSER library.  You might want to see if that is where your file is.

Occasional Contributor
Posts: 8

Could you help me to see what I did wrong that my infile function can't locate my file? Thanks!

I can upload the data without problem under my library, but the programming is not performed, I just have an additional sas file with raw data in the file. All the input commands are not performed...

Ask a Question
Discussion stats
  • 29 replies
  • 5564 views
  • 6 likes
  • 7 in conversation