0

I am importing excel xlsx file. it contains some date values. i want to specify informat

proc import out=test 
/* i tried input and informat but it did not work */
datafile="C:\Users\ALCopy.xlsx" 
dbms=excel replace;
range="Test1$"; 
getnames=no ;
mixed=no;
scantext=yes;
usedate=no;
scantime=no; 
run;

I tried userdate=yes but this did not work for all date columns . Many of then were treated as string columns . How can I set up informat for each column individually ?


i tried changing it later with informat statement but it did not work

1 Answer 1

1

You can use the DBSASTYPE option to specify how a column is brought in.

DBDSOPTS="DBSASTYPE=(datevar='DATE')";

This doesn't always work depending on why it is not automatically coming in right, but it sometimes does.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.