BookmarkSubscribeRSS Feed
Arora_S
Obsidian | Level 7

I have an excel file (xlsx) with mixed - character and numeric format. While using proc import statement , SAS converts all character dates in sas date format but moves them ahead by 60 years.

I want to read the excel file as such with NO formatting change - basically read and output the data the way it is in excel exactly.

Tried using Mixed = yes (works only in xls and not xlsx). DBDSOPTS = DBTYPE =option is also not working in SAS EG 6.1.

Input data looks like this in excel sheet:

Results

           XYZ                    ABCD

date      Number Value    Amount(Number)

Jan-09    98363                 -

Mar-10    57245                -

Dec-15   6824648          (100)  Note: Parentehesis This is a negative number in excel

Need output SAS data set should like this as above:

Results

           XYZ                    ABCD

date      Number Value    Amount(Number)

Jan-09    98363                 -

Mar-10    57245                -

Dec-15   6824648          (100) 

Appreciate all help on this .

thanks

3 REPLIES 3
Ksharp
Super User

Try option  scandate=no   ;

or try to save it as CSV file ,then import it again.

Arora_S
Obsidian | Level 7

It's not working in ENTERPRISE GUIDE

ballardw
Super User

I suggest opening the EXCEL file, finding that cell and examining the contents. A displayed value of 1-Jan-15 could be 1/1/2615 when displayed with the Excel display setting using the dd-mmm-yy type of display.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1279 views
  • 0 likes
  • 3 in conversation