08-29-2016 11:26 PM - edited 08-29-2016 11:28 PM
Please help me to write a code to Import multiple excel workbooks(.xlsx) with same worksheets in Linux into a SAS dataset. I have tried PROC IMPORT but it works only for a workbook. I have tried many macros in SAS communities which are not helpful, please help me with macro which loops the files to complete this job
PROC IMPORT DATAFILE= "/path/*.xlsx" OUT= FILES_CONSOLIDATED DBMS=XLSX REPLACE; SHEET="Sheet1"; GETNAMES=YES; DATAROW= 2; RUN;
08-30-2016 12:14 AM
Check out this sample SAS macro for reading all CSVs in a directory. With a bit of tweaking it should work for reading same sheet in each Excel workbook:
08-30-2016 12:45 AM
You can't use wildcards to read multiple XLSX files. You need to generate multiple proc import statements and there are a multitude of ways to do so.
If you search on here you'll find many examples. It doesn't matter than your on Linux, the process is the same.
Get a list of files
import each file.