Hi everyone, I am quite new on SAS. Now I have a problem of importing excel into SAS. I have a worksheet in which I have multiple ranges of rating coeffs. Now I was supposed to import these ranges of table one by one. But now I want to have a macro function which can help import these tables in a row. What I have done right now is a macro function like this: %macro import_table(name_of_table, range_limit1, range_limit2); proc import datafile= "C:\...\myfile\rating_table.xlsm" out = table_&name_of_table dbms=excelcs replace; sheet="different_tables$" range= "&range_limit1:&range_limit2"; run; %mend; This macro function works well. As example %import_table(rate1,A2,BI8) can import the this table successfully. In the meantime, I also have imported a data sheet into SAS in which we have information about different range limits for each rating table. I have imported something like this(named abcd), indice name_of_table limit1 limit2 1 aa A2 BI8 2 bb A10 BI50 3 cc A52 BI 240 4 ... 22 So this data sheet includes 22 rows. What I want is to create a macro function to import automatically all these rating tables in a row. I wanted to use the data sheet abcd to get range limits and table name for each table, then use these three values in the macro function import_table. So, I'd like to have something like, %macro import_all(); do i=1 to 22; import_table(name_of_table, limit1, limit2); end; %mend; Is it possible to have something like that? I tried a lot but I am not able to achieve.... Many thanks for your help.
... View more