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

Hello

I am importing a table from Excel 2010 using SAS 9.2.  This has never been a problem before but now SAS isn't importing all columns.  The table is from A1 to OQ366 and SAS only imports to IU366.  I even forced the range by using the worksheet and name in the import syntax i.e.

"ImportFile$A1:OQ366". For another table that is A1 to NB366 it only imports to MH366.

Is there a specified limit to the number of columns imported?  Is there any way I can force the import?  Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

I can only test it on 9.3.  The following worked for me on a 64-bit Windows 2008 server:

%let import_path=d:\art\widetest.xlsx;

Proc IMPORT OUT= WORK.MASTER_NEW_B1

  DATAFILE= "&import_path"

  DBMS=XLSX REPLACE;

  getnames=no;

run;

View solution in original post

7 REPLIES 7
art297
Opal | Level 21

Post the code that you used.  Column IU, which I think is column 255, makes me think that you are attempting to import using one of the older engines.  Are you running base SAS or are you using EG?  Do you license SAS/Access for pcfile formats?

PGStats
Opal | Level 21

I believe the ACE library (a Microsoft product) which is the interface used by SAS to access Excel and Access files is still limited to 255 column on import and export.

PG

PG
art297
Opal | Level 21

I think the libname engine still has those limits but, with the latest version of 9.2 (M 3 I think), proc import and proc export can deal with the actual new excel capabilities.

shellp55
Quartz | Level 8

Hi

The code I used to import is:

Proc IMPORT OUT= WORK.MASTER_NEW_B1

DATAFILE= &import_path

DBMS=EXCELCS REPLACE;

Range = "B1$";

Scantext = Yes;

UseDate = Yes;

run;

Note that B1 is the name of the worksheet.  So is there any way to get around the import column limit?

Thanks.

Shelley

art297
Opal | Level 21

I can only test it on 9.3.  The following worked for me on a 64-bit Windows 2008 server:

%let import_path=d:\art\widetest.xlsx;

Proc IMPORT OUT= WORK.MASTER_NEW_B1

  DATAFILE= "&import_path"

  DBMS=XLSX REPLACE;

  getnames=no;

run;

shellp55
Quartz | Level 8

Hi Arthur

Thanks so much....I don't know why I said I had 9.2 because I do have 9.3!!  I'm assuming the "getnames" is for the column head labels?

art297
Opal | Level 21

Yes.  If you have column head labels then use getnames=yes;

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
  • 7 replies
  • 8031 views
  • 3 likes
  • 3 in conversation