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
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
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.