DATA Step, Macro, Functions and more

CSV Import problem

Reply
Contributor
Posts: 51

CSV Import problem

Dear forum members,

I've got another problem here I cannot handle.

I am trying to read a CSV file into a dataset with all input data being alphanumeric. It works pefectly like this:

Data &_output.;
infile "&STGPfad/&_infile" delimiter=';' firstobs=2;
informat default=$1024.;
input (fld1-fld&nr) ($);
Run;

When it comes to a CSV row like

3;4;5;6;7;;8;9

the missing value is not taken as "." but the "8" is taken from the next field and so on, which is...well..wrong.

So I tried "MISSOVER" in the INFILE statement, but still it doesn't work.

Any other ideas would help me a lot.

Thanks and regarsd,
Thomas
Super Contributor
Super Contributor
Posts: 3,174

Re: CSV Import problem

Add the DSD parameter to the INFILE statement.

Scott Barry
SBBWorks, Inc.
Contributor
Posts: 51

Re: CSV Import problem

That helped, thanks! I was trying with DSD and MISSOVER in parallel, which screwed it up even more Smiley Wink

Thomas
Ask a Question
Discussion stats
  • 2 replies
  • 113 views
  • 0 likes
  • 2 in conversation