SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

CSV infile for strings long then 8

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

CSV infile for strings long then 8

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

 


Accepted Solutions
Solution
‎05-15-2018 03:48 PM
PROC Star
Posts: 1,569

Re: CSV infile for strings long then 8

[ Edited ]
Posted in reply to underarmnat

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

View solution in original post


All Replies
Solution
‎05-15-2018 03:48 PM
PROC Star
Posts: 1,569

Re: CSV infile for strings long then 8

[ Edited ]
Posted in reply to underarmnat

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

Occasional Contributor
Posts: 7

Re: CSV infile for strings long then 8

Posted in reply to novinosrin

That worked perfect,

Thanks!

Contributor
Posts: 70

Re: CSV infile for strings long then 8

Posted in reply to underarmnat

@underarmnat If your question has been answered, you could mark as answered and close the thread

Contributor
Posts: 70

Re: CSV infile for strings long then 8

Not mine. You should have marked whomsoever who gave you the solution. lol 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 184 views
  • 1 like
  • 3 in conversation