DATA Step, Macro, Functions and more

Problem in importing excel file

Accepted Solution Solved
Reply
Super Contributor
Posts: 266
Accepted Solution

Problem in importing excel file

proc import datafile = "C:\Users\loveislife\Desktop\data.xls" out =bank1 replace   

dbms=excel  ;

getnames=yes ;

sheet=sheet1;

run;

proc print data=bank1;run;

i m using this code to import a excel file(attached ) . i m getting 3 extra variable like F7,F8,F9,

Can anyone help me to let me know why i m getting these extra fields?????????


Accepted Solutions
Solution
‎09-07-2013 03:46 PM
Super User
Super User
Posts: 7,059

Re: Problem in importing excel file

Because that is what your spreadsheet has in it.  When I open your attachment and press CTRL-END it jumps to column I row 713.  So your spreadsheet has three empty columns.  You can either drop them on the SAS side or edit the spreadsheet and delete those columns.

View solution in original post


All Replies
Solution
‎09-07-2013 03:46 PM
Super User
Super User
Posts: 7,059

Re: Problem in importing excel file

Because that is what your spreadsheet has in it.  When I open your attachment and press CTRL-END it jumps to column I row 713.  So your spreadsheet has three empty columns.  You can either drop them on the SAS side or edit the spreadsheet and delete those columns.

Super Contributor
Posts: 266

Re: Problem in importing excel file

Thanks for your kind help.

🔒 This topic is solved and locked.

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

Discussion stats
  • 2 replies
  • 234 views
  • 1 like
  • 2 in conversation