Desktop productivity for business analysts and programmers

Reading a formula cell in a spreadsheet

Reply
Occasional Contributor
Posts: 6

Reading a formula cell in a spreadsheet

I am reading a spreadsheet in SAS EG 4.3 using File->Import data-> etc,. A column that contains the result of a user defined function that returns a string  is read as missing. But if I set the use "SAS/Access to PC files" option then it works. Why? Is there a fix other than always to set that option which causes other issues?

Super User
Posts: 11,343

Re: Reading a formula cell in a spreadsheet

Posted in reply to stephenjdunn

Different data engines, different results.

The import task uses Proc Import which has to guess more about your results and uses very few rows when looking at Excel files.

 

Are all cells "missing" or only some? Is the variable that represents that cell numeric or character after the import using the File>Import?

If your variable is numeric than that may well mean that the first rows of the file had numeric appearing values such as strings of '123' or blank and the procedure guessed the data should be numeric. Then the rows that were returning actual string values further down in the set that contained strings such as 'ABC' were then treated as invalid numerics.

 

The main fix is to avoid spreadsheet files as a data interchange medium as much a possible. Or to convert them to CSV and write a datastep or modify one created by Proc Import or the import task to control such things a variable types.

 

Search here for "Excel import problem" and find many examples of issues with spreadsheet data.

Occasional Contributor
Posts: 6

Re: Reading a formula cell in a spreadsheet

Hi

All entire column is missing on import even though every cell in the column in the spreadsheet is populated with a character string.

You say avoid using Excel as a direct import and go via a text file but that is exactly what Enterprise Guide does - it get Excel to write the data out as a tab delimited file and then reads it in via a data step. If I open the text file it creates the data is missing in that. If create a similar text file from Excel via 'File->Save as...' then the column is not full of missing values. Just a bug or fixable?



P.S. Using SAS EG 4.3 against a local install of SAS9.4M1 on Windows.


Super User
Posts: 19,789

Re: Reading a formula cell in a spreadsheet

Posted in reply to stephenjdunn
EG 4.3 is really, really really old. If you have an option to upgrade I would seriously consider it.
Ask a Question
Discussion stats
  • 3 replies
  • 284 views
  • 2 likes
  • 3 in conversation