Learning SAS? Welcome to the exclusive online community for all SAS learners.

error reading a .CSV file using INFILE statement

Reply
Occasional Contributor
Posts: 6

error reading a .CSV file using INFILE statement

Hi, I'm getting this error whilst import .CSV file from the location

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

42 ;

43 data Employee1;

44 INFILE '/folders/myfolders/employee.csv' dlm=',' dsd;

45 informat ID $3. Name $20. Depart $8. DateHire MMDDYY10. Salary DOLLAR8.;

46 input ID Name $ Depart £ DateHire Salary;

47 Format DateHire MMDDYY10. Salary DoLLAR8.;

48 run;

ERROR: Physical file does not exist, /folders/myfolders/employee.csv.

NOTE: The SAS System stopped processing this step because of errors.

WARNING: The data set WORK.EMPLOYEE1 may be incomplete. When this step was stopped there were 0 observations and 6 variables.

NOTE: DATA statement used (Total process time):

  real time 0.01 seconds

  cpu time 0.02 seconds

  

49 ;

50 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

60 ;

please help!

--

Nanita

Super User
Posts: 11,343

Re: error reading a .CSV file using INFILE statement

Posted in reply to NanitaPatel

check spelling and possibly case of the file name after making sure that the CSV is actually in that folder.

SAS Employee
Posts: 56

Re: error reading a .CSV file using INFILE statement

Posted in reply to NanitaPatel

Hi Nanita,

I think your code is fine - I was able to successfully import a .CSV file using your code. 

You can verify that your employee.csv file is in your myfolders folder by looking in the Folders section of the navigation pane:

csvimport.gif

If it's not there, you can copy it to the myfolders directory that you created on your local computer and look again.  You might need to refresh the folders in SAS Studio to see it.

For information about accessing your existing data, you might find the following FAQ topic and video helpful:

How do I create a folder shortcut to my existing SAS files?

Accessing Your Existing Data: for SAS University Edition

thanks,

Jennifer

Occasional Contributor
Posts: 6

Re: error reading a .CSV file using INFILE statement

Posted in reply to jennifert

Hi Jennifert,

I checked my folder my employee.csv file exist in 'myfolders' but I still receive the same error message

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

42 ;

43 data Employee1;

44 INFILE '/folders/myfolders/employee.csv' dlm=',' dsd;

45 informat ID $3. Name $20. Depart $8. DateHire MMDDYY10. Salary DOLLAR8.;

46 input ID Name $ Depart $ DateHire Salary;

47 Format DateHire MMDDYY10. Salary DOLLAR8.;

48 run;

ERROR: Physical file does not exist, /folders/myfolders/employee.csv.

NOTE: The SAS System stopped processing this step because of errors.

WARNING: The data set WORK.EMPLOYEE1 may be incomplete. When this step was stopped there were 0 observations and 5 variables.

WARNING: Data set WORK.EMPLOYEE1 was not replaced because this step was stopped.

NOTE: DATA statement used (Total process time):

  real time 0.01 seconds

  cpu time 0.01 seconds

  

49 ;

50 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

60 ;

--

Nanita

Super User
Posts: 19,832

Re: error reading a .CSV file using INFILE statement

Posted in reply to NanitaPatel

can you  include a screenshot like Jennifer's, showing the file and code in SAS UE?

Occasional Contributor
Posts: 6

Re: error reading a .CSV file using INFILE statement

scrnshot1.png

Super User
Posts: 11,343

Re: error reading a .CSV file using INFILE statement

Posted in reply to NanitaPatel

Your screen shot kind of looks like employee.csv is in Myfolder not myfolders.

Super User
Posts: 19,832

Re: error reading a .CSV file using INFILE statement

Posted in reply to NanitaPatel

That is under Folder Shortcuts not My Folders.

You should see the sasuser.v94 as the first folder in the list where your file is located.

It is the same location as when you set up the myfolders in the SAS University Edition folder.

Please watch the video here:

SAS Video

You should see the following in your SAS Studio start up screen:

MyFolders Set Up.png

Ask a Question
Discussion stats
  • 7 replies
  • 831 views
  • 0 likes
  • 4 in conversation