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
@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
You can always save to csv, either with Excel or alternative software (e.g. LibreOffice).
The alternatives can even provide a CLI for such actions.
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?
@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
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;
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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.