I tried to import the attached xlsx file; in the HOLNO column, most of the data were imported except the last row which is in character format.
I would like to import the HOLNO column as character format wihout modifying the excel file.
Anyone can help? Thanks.
My code:
PROC IMPORT DATAFILE="D:\Book1.xlsx"
dbms=excel replace out=mydata;
GETNAMES=yes;
RUN;
I have tried but still got the same answer.
Export to a csv file from Excel and write a data step to read that; that way you have full control over the variables and are not subject to the idiosyncrasies of the Excel file format and the guessing of proc import.
Add MIXED='yes' ; option Or not sure if the following could work. libname xx excel "/folders/myfolders/Book1.xlsx"; data have; set xx.'Sheet1'n(dbsastype=(holno='char(100)')); RUN;
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!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.