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?
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.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.