BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Phoebelee
Fluorite | Level 6

Hey everyone!

 

I am trying to import a dataset downloaded from California Health and Human Services website, in csv format. The file has about 893 rows and 5 columns. I want to import the file and build a dataset, so that I can do further research. But the log keeps showing that my sas cannot read the file.("0 records were read from the infile"), and I don't know how to fix that. so Here is the i am using:

 

DATA ETHINICITY;
INFILE 'C:\Users\Administrator\Downloads\Violent_Crime_Rate_California_2006-2010.csv'

lrecl=32767 missover pad;
RUN;

 

Here is the log:

The infile 'C:\Users\Administrator\Downloads\Violent_Crime_Rate_California_2006-2010.csv'
is:
Filename=C:\Users\Administrator\Downloads\Violent_Crime_Rate_California_2006-2010.csv,
RECFM=V,LRECL=32767,File Size (bytes)=1319201,
Last Modified=23Apr2017:22:22:13,
Create Time=23Apr2017:22:22:12

NOTE: 0 records were read from the infile
'C:\Users\Administrator\Downloads\Violent_Crime_Rate_California_2006-2010.csv'.
NOTE: The data set WORK.ETHINICITY has 1 observations and 0 variables.

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

Also, the file ;you attached isn't the same on you specified on the infile statement. Assuming the file you attached is the correct one, and that it's in the same location as the other file you specified, the following should work:

 

DATA ETHINICITY;
  INFILE 'C:\Users\Administrator\Downloads\Physicians_and_Surgeons_by_Race_Ethnicity_and_Practice_Location.csv'
    dlm=',' lrecl=32767 missover firstobs=2 pad;
  informat Primary_Practice_County $14.;
  informat Race_Ethnicity $36.;
  input Month $ Year Primary_Practice_County Race_Ethnicity Count_of_Licensees;
RUN;

Art, CEO, AnalystFinder.com

View solution in original post

3 REPLIES 3
art297
Opal | Level 21

You don't have an input statement specifying the variables to input.

 

I didn't look at the file but, if it has a header row (i.e., a row with the variable names), you might find it easier to use proc import.

 

Art, CEO, AnalystFinder.com

 

art297
Opal | Level 21

Also, the file ;you attached isn't the same on you specified on the infile statement. Assuming the file you attached is the correct one, and that it's in the same location as the other file you specified, the following should work:

 

DATA ETHINICITY;
  INFILE 'C:\Users\Administrator\Downloads\Physicians_and_Surgeons_by_Race_Ethnicity_and_Practice_Location.csv'
    dlm=',' lrecl=32767 missover firstobs=2 pad;
  informat Primary_Practice_County $14.;
  informat Race_Ethnicity $36.;
  input Month $ Year Primary_Practice_County Race_Ethnicity Count_of_Licensees;
RUN;

Art, CEO, AnalystFinder.com

Phoebelee
Fluorite | Level 6
Thank you so much! I do attach a wrong file, and I should have checked it carefully, but it perfectly solved my problem!

sas-innovate-2024.png

 

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 2412 views
  • 1 like
  • 2 in conversation