How are you going to do the merge? You need some common variable in each table to join on to avoid a cartesian product in SQL. If there is none a datastep merge without a by variable might work for you though the result may not be quite what you expect. Step 1: set up a macro to do the merge - here assuming no common variable %macro merge_ctry (ctry, crncy) ; data &ctry._combined ; merge ctry_&ctry crncy_&crncy ; run ; %mend ; Step 2: use a datastep to execute the macro for each ctry - crncy pair data _Null_ ; set countries ; if exist(ctry) and exist(crncy) ; exec_macro = cats('%merge_ctry(', ctry, ', ', crncy, ');') ; /* single quotes essential */ call execute (exec_macro) ; run ; NB the macro invocations will be streamed to execute after the data step terminates. Obviously this is untested but it is a viable approach. Richard
... View more