Hello everyone,
I have a Excel file named ALL, and sheet named SHEET1.
Not like using proc import ,,,when I use libname to connect excel file to SAS such as:
libname xl Excel "C:\Temp\ALL.xls"; I can get a SAS dataset xl.SHEET1.
BUT if the first 8 obs of a column is empty, then this column will be set to length $1. and all the numeric value of this column will be set to empty.
So if I still want to use libname I have to set a value in the first 8 obs.
Please give me some suggestion on it!
Thanks!
Mike
This is a bit messy, but fortunately, you will have to do this only once. The problem lies with the number of lines that Excel scans to determine the properties of columns. You must change the TypeGuessRows entry in Windows registry. This is described on page 36 of the document :
http://support.sas.com/documentation/cdl/en/acpcref/63184/PDF/default/acpcref.pdf
PG
Thanks PG,
but I don't have the permit to change the computer's setting,,,,,,so what I can do only is add an extra row on the top to define the columns' properties?
Thanks
Mike
Bt default, Excel scans only the first 8 lines of a table to determine the column properties. So, yes, putting your longest possible string within the first 8 lines will do the trick. - PG
Did you try some option similar to proc import ?
libname x excel 'c:\xx.xls' scantext=yes mixed=yes;
Thanks Ksharp,
I had tried these options before
I am sure this is not a new problem, if you could find an option like that would be fantastic!
Thanks
Mike
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.