06-09-2016 04:21 AM
I am trying to import data from excel (I can not use csv) however guessing rows i want to fix as 10000
I believe i can not use guessing rows as DBMS EXCEL.
Please suggest .
Thanks a lot .
PROC IMPORT OUT= AMPO.&out.
06-09-2016 04:26 AM
Tip, avoid coding all in upper case, it makes code hard to read. You are quite right that guessingrows only applies to delimited files:
The guessing rows for Excel is defined in a registry entry - this is the library of system options and such like for your OS - so you would need your IT group to change it.
Why can you not use CSV? Just save the file from Excel and choose file type CSV, save it somewhere then write a datastep import program for it. That would always be my preferred option. The second question I had was why would you specify the guessingrows as 1000, its not clear why the decision on that. You can force certain formats by adding a row to excel at the top which is of the type and length you require.
06-09-2016 05:48 AM
If you have a later version of SAS try DBMS=XLSX
However there's no absolute way to specify the variable type while using Excel so you may need to implement fixes after the initial import.