BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Hawkeye
Fluorite | Level 6

Good day all,

I am trying to import a .xlsx file and have the first line take in only what is literally in the file as far as the variables are concerned. Instead the way I have it set up now, it takes the format that is in excel and puts it in the sas datetime. format.

To give you an idea of the dataset:

building     10-jun     10-jul     10- aug ....

Is there an option in the proc import statement to ignore the format that is applied to the variables?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Hawkeye
Fluorite | Level 6

Well I am not really sure what happened but it worked, here is what I ended up using.

proc import out=work.data

        datafile =  'filepath'

        DBMS = EXCEL Replace;

    RANGE="Sheet1$";

    getnames = yes;

    mixed = no;

    scantext = yes;

    usedate = yes;

    scantime = no;

run;

I am really confused because it wouldn't run, I got up to walk around and clear my head.  Ran it again without changing anything and it worked.

View solution in original post

6 REPLIES 6
Reeza
Super User

You can set scantime/scandate to no in your proc import, but that might not help with other data types.

Otherwise you can see some of the options in this thread here:

http://listserv.uga.edu/cgi-bin/wa?A1=ind1208a&L=sas-l#31

Hawkeye
Fluorite | Level 6

scandate or usedate?

Reeza
Super User

scandate is for excel and usedate is for access I believe.

Hawkeye
Fluorite | Level 6

no usedate is for .xlsx

Hawkeye
Fluorite | Level 6

Well I am not really sure what happened but it worked, here is what I ended up using.

proc import out=work.data

        datafile =  'filepath'

        DBMS = EXCEL Replace;

    RANGE="Sheet1$";

    getnames = yes;

    mixed = no;

    scantext = yes;

    usedate = yes;

    scantime = no;

run;

I am really confused because it wouldn't run, I got up to walk around and clear my head.  Ran it again without changing anything and it worked.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 6 replies
  • 7581 views
  • 6 likes
  • 2 in conversation