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.
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
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
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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.