James
since you are using DDE, you are writing datasteps with infile statements. If your data in these excel workbooks will have consistent structure(column order and informats), you could use one input statement combined with an infile statement like:
infile dumx device= dde filevar= next_trip dsd dlm='09'x lrecl= 10000 ....... ;
You just need to ensure that when the infile statement is executed, the variable next_trip will contain the dde triplet through which you next want to read from excel.
(and that the workbook is open).
Personally, I prefer to insert range names for each set of excel data I want to load, and use libraries for each workbook.
libname bk1 'my workbook1.xls' access= readonly ;
proc copy in=bk1 out= work mt= data ; run;
Although it might appear like more work, it is little more than verifying that each data appears OK.
It also removes the need to have data step code to perform the excel open() and close() of the relevant workbooks.
But, surely E.G. should relieve you of the need to use DDE ?
PeterC