BookmarkSubscribeRSS Feed
jack1078
Calcite | Level 5

Hi all,

I have a problem to import an excel file with xls = dbms.

I have a datetime field format var1 "03/11/2015 10:04:04" with two space between the date and time. When I import the file I truncates the field by putting only the date. How can I import the field as described above?

thank's a lot

bie bie

PROC IMPORT OUT= WORK.OFFERTE_EB

            DATAFILE= "my path"

            DBMS=xls REPLACE ;

  GETNAMES=yes;

RUN;

3 REPLIES 3
ballardw
Super User

When automatic conversions from Excel fail (moderately often due to Excel users) one solution is often to save the Excel to another format such as CSV an import that file as you can modify the code generated by a proc import call to use custom formats or provide more complicated parsing.

jack1078
Calcite | Level 5

I can not change the file format should I use excel and I can not change the format of the field excel

Reeza
Super User

Can you access the file via the libname method?

Look into DBASTYPE option, as well as scandate, scantime options.

sas-innovate-2024.png

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.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 834 views
  • 0 likes
  • 3 in conversation