In reply to Rick Wicklin.

Rick, sorry if I am being confusing. Acknowledged, my usage examples are too simplistic, which makes it possible to replicate usage case 1 with your first data step above. But what I wanted to accomplish by the ddlist macro is to be able to use it in cases where a data table other than driver table is processed by data step, e.g.:
data outtable;
set intable;
do i=%ddlist(driver_table,driver_var);
/* some processing of intable */
end;
run;

Your second example also quite valid and simple, but it would only work for numeric values. See above Wes Patton's comments and my replies. ddmacro works for both, numeric and character values.

The idea was to create a single macro that simulates do loop with a list of values stripping all hard-coded values from the code.