Help using Base SAS procedures

How to import CSV (excel) file

Reply
Super Contributor
Posts: 272

How to import CSV (excel) file

Dear,

 

I am trying ti import a csv file(excel). I am not able to import. Please help. The log is shown in the attachment

 

Mycode;

proc import datafile="C:\Users\nn\Desktop\pp.csv" DBMS=csv out=mm;

run;

Super User
Posts: 11,343

Re: How to import CSV (excel) file

Posted in reply to knveraraju91

The message about more variables found than values means that some of your columns didn't have a header.

Mismatch types usually mean the 'guessingrows' default isn't large enough.

 

Try

 

proc import datafile="C:\Users\nn\Desktop\pp.csv" DBMS=csv out=mm;

   guessingrows = 100;

run;

Super User
Posts: 19,770

Re: How to import CSV (excel) file

Posted in reply to knveraraju91

Based on your knowledge of the dataset, I would suggest taking the code from the log and manually fixing it to match your desired formats.

Ask a Question
Discussion stats
  • 2 replies
  • 241 views
  • 1 like
  • 3 in conversation