Buras
Buras

Reputation: 3099

How to specify informat when importing xlsx

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

Upvotes: 0

Views: 2554

Answers (1)

Joe
Joe

Reputation: 63424

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.

Upvotes: 1

Related Questions