|
Hi Paul,
Thank you, it is an answer I expected to get. brilliant.
On Thu, 14 Feb 2008 14:04:19 -0800, pchoate <paulchoate61@GMAIL.COM> wrote:
>Hi Ben -
>
>Without a foreknowledge of the data the only "safe" format is a
>character format. Here is an example of how the dbsastype dataset
>option can control input of Excel columns.
>
>libname exbk excel 'SasHelp.xls' ;
>DATA exbk.Class;
> SET SASHelp.Class;
> Blanks=' ';
> Missings=.;
> Missings2='.';
>
>run;
>libname exbk clear;
>
>libname exbk excel 'SasHelp.xls' ;
>DATA Class1;
> SET exbk.Class;
>DATA Class2;
> SET exbk.Class(dbsastype=(height='CHAR(8)'
> blanks='CHAR(8)'
> Missings='CHAR(8)'
> Missings2='CHAR(8)'));
>run;
>libname exbk clear;
>
>Note how the decimals on Height didn't come through quite the same -
>beware of rounding issues.
>
>
>More info here:
>www2.sas.com/proceedings/sugi31/024-31.pdf
>www2.sas.com/proceedings/forum2007/119-2007.pdf
>
>hth - Paul Choate
>
>
>On Feb 14, 12:14 pm, benp...@YAHOO.COM (Ben) wrote:
>> It seems that the statement "mixed=YES;" in PROC IMPORT does not always
>> work.
>>
>> wonder if there is an option or statement we can use to tell SAS to keep
>> column's character type no matter what the data value in excel looks
like,
>> no guessing.
>>
>> Many Thanks.
|