DATA Step, Macro, Functions and more

how to import excel file using infile

Accepted Solution Solved
Reply
Contributor
Posts: 20
Accepted Solution

how to import excel file using infile

Please help me in importing excel file using infile statement. How can i import gold.xls platinum.xls and titanium.xls separately. 

 

 

 


excel.PNG

Accepted Solutions
Solution
‎11-15-2016 02:46 AM
PROC Star
Posts: 734

Re: how to import excel file using infile

Posted in reply to ROHINISDAS

Hi . Why are you trying to read an Excel file via a data step?

The Data step is good for importing txt and csv files, not excel.

 

I would use proc import.

 

 

View solution in original post


All Replies
Solution
‎11-15-2016 02:46 AM
PROC Star
Posts: 734

Re: how to import excel file using infile

Posted in reply to ROHINISDAS

Hi . Why are you trying to read an Excel file via a data step?

The Data step is good for importing txt and csv files, not excel.

 

I would use proc import.

 

 

Contributor
Posts: 20

Re: how to import excel file using infile

i tried doing through proc import and it was successful. Now i want to try the same through infile statement.
Super User
Posts: 7,762

Re: how to import excel file using infile

Posted in reply to ROHINISDAS

You CANNOT import an Excel file through the infile method. This method is for reading text files, which Excel files are not.

If you want to read data from Excel in a data step with infile, you need to export your Excel spreadsheet to a text-based file format like csv.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 20

Re: how to import excel file using infile

Posted in reply to KurtBremser
thank you providing new information.
☑ This topic is solved.

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

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