Is it possible to import an Excel file using SAS data step?
It may be possible, but the effort required to write DATA step code from scratch probably isn't worth the effort. PROC IMPORT is one way to go. A LIBNAME statement with engine EXCEL is another way to go.
Why do you ask?
Reading an Excel into SAS is supported by a couple of methods:
See this article for more information: How Do I Read and Write Excel Files Using SAS? Q&A, Slides, and On-Demand Recording
Some people misunderstand CSV, a text file format, as an "Excel" file because of the association with the program will often open in Excel by default. For these files a data step is actually the better method to read the files as you control all the details of variable type, name, labels and can even use custom informats to read certain types of problematic values.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.