BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
NewUsrStat
Lapis Lazuli | Level 10

Hi guys, 

is there a way to proc import an excel file with 463 columns (variables)? 

It is truncated and I cannot save the original file in .csv file format. 

 

 

Thank you in advance

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

@NewUsrStat wrote:

Hi guys, 

is there a way to proc import an excel file with 463 columns (variables)? 

It is truncated and I cannot save the original file in .csv file format. 

 

 

Thank you in advance

 

 


How did you try to import it?  I am able to import an XLSX file with 500 columns.

25   proc import file="c:\downloads\large.xlsx"
26     dbms=xlsx out=want replace;
27   run;

NOTE: The import data set has 1 observations and 500 variables.
NOTE: WORK.WANT data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.14 seconds
      cpu time            0.01 seconds

View solution in original post

6 REPLIES 6
Kathryn_SAS
SAS Employee

What options are you using in PROC IMPORT? Did you try DBMS=XLSX? Can you send your code and/or log that shows the code and messages you are getting?

Tom
Super User Tom
Super User

@NewUsrStat wrote:

Hi guys, 

is there a way to proc import an excel file with 463 columns (variables)? 

It is truncated and I cannot save the original file in .csv file format. 

 

 

Thank you in advance

 

 


How did you try to import it?  I am able to import an XLSX file with 500 columns.

25   proc import file="c:\downloads\large.xlsx"
26     dbms=xlsx out=want replace;
27   run;

NOTE: The import data set has 1 observations and 500 variables.
NOTE: WORK.WANT data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.14 seconds
      cpu time            0.01 seconds
NewUsrStat
Lapis Lazuli | Level 10

Here the code: 

 

proc import out= work.myw
            datafile= "\...\.xlsx" 
            dbms=excel replace;
     range="mysheet$"; 
     getnames=yes;
     mixed=no;
     scantext=yes;
     usedate=yes;
     scantime=yes;
run;
Tom
Super User Tom
Super User

Possibly it was EXCEL that could not handle the large number of variables?

Use the XLSX engine and take EXCEL out of the loop.  You don't need most of those optional statements, either because they are the default or they just don't apply.

proc import out= work.myw replace
  dbms=xlsx  datafile= "\...\.xlsx" 
;
  sheet= 'mysheet';
run;
NewUsrStat
Lapis Lazuli | Level 10
Thank you very much for the indications.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 759 views
  • 1 like
  • 4 in conversation