Hi,
I have a text file that looks like this:
State,State ANSI,County ANSI,County Name,ANSI Cl
AL,01,001,Autauga County,H1
AL,01,003,Baldwin County,H1
AL,01,005,Barbour County,H1
AL,01,007,Bibb County,H1
AL,01,009,Blount County,H1
AL,01,011,Bullock County,H1
The file is also attached.
How can I get this into SAS? I tried a few ways but I couldn't get it to have a data set with 5 columns with the corresponding headings.
Amanda
It actually appears to be a comma delimited file. Couldn't you just use something like:
data want;
infile "c:\art\names.txt" dlm="," dsd firstobs=2;
length State State_ANSI ANSI_Cl $2;
length County_ANSI $3;
length County_Name $50;
input State State_ANSI County_ANSI County_Name ANSI_Cl;
run;
It actually appears to be a comma delimited file. Couldn't you just use something like:
data want;
infile "c:\art\names.txt" dlm="," dsd firstobs=2;
length State State_ANSI ANSI_Cl $2;
length County_ANSI $3;
length County_Name $50;
input State State_ANSI County_ANSI County_Name ANSI_Cl;
run;
Sorry, yes, comma delimited. Thanks so much! The code worked perfect.
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.