Morning all,
I am trying to read in a csv dataset with first and middle name and then a last name,and I know it trucates at 8 letters, but from reading forums I can't crack the code that imports the variables in their full format.
My current code (excluding length attempts is)
data namesofromanemperors_csv;
infile "/home/natelucaswelling0/romans/romanemperors.csv" firstobs=2 dlm=',' missover;
input studyno firstplusmiddle $ surname $;
run;
I have then tryed variations, but this results in variables being not included if they don't have 25 letters...
data namesofromanemperors_csv;
infile "/home/natelucaswelling0/romans/romanemperors.csv" firstobs=2 dlm=',' missover;
input studyno firstplusmiddle $25. surname $15.;
run;
Thanks in advance for advice
I think you are missing colon format modifier like this
data namesofromanemperors_csv;
infile "/home/natelucaswelling0/romans/romanemperors.csv" firstobs=2 dlm=',' missover;
input studyno firstplusmiddle : $25. surname : $15.;
run;
or show us an example of couple of datalines samples please
I think you are missing colon format modifier like this
data namesofromanemperors_csv;
infile "/home/natelucaswelling0/romans/romanemperors.csv" firstobs=2 dlm=',' missover;
input studyno firstplusmiddle : $25. surname : $15.;
run;
or show us an example of couple of datalines samples please
That worked perfect,
Thanks!
@underarmnat If your question has been answered, you could mark as answered and close the thread
Not mine. You should have marked whomsoever who gave you the solution. lol
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.