Let me try it. data table_1;
input name $ low $ high $;
datalines;
A Y010 Y013
B B2R300 B2R305
C NN10 NN13
D 6503 6505
;
run;
data want;
set table_1;
length pre_low pre_high want $ 40;
_low=input(strip(scan(low,-1, ,'kd')),best8.);
l=find(low,strip(_low));
_high=input(strip(scan(high,-1, ,'kd')),best8.);
h=find(high,strip(_high));
if l eq 1 then call missing(pre_low);
else do;ll=l-1;pre_low=substr(low,1,ll) ; end;
if h eq 1 then call missing(pre_high);
else do;hh=h-1;pre_high=substr(high,1,hh) ; end;
do value=_low to _high;
want=cats(pre_low,value);
output;
end;
keep name want;
run;
Ksharp
... View more