this is @Reeza code modified for your needs noted by @novinosrin. FYI, record 2 fulfills your condition where a record may have more columns than expected. data have;
infile cards truncover;
input myVar $255.;
cards;
084375EJ9084375EK6084375EL4
084375EJ9082375EK6084325EL4084395EJ9084395EK6084395EL4
074375EJ9089375EK6084335EL4
064375EJ9084375EK6084345EL4
;;;;
run;
proc print data=have;
run;
data want;
set have;
Obs = _n_; *record number to know which go together;
len = length(myVar); *legnth of variable to loop only as needed;
do i=1 to len by 9; *loop;
value = substr(myVar, i, 9); * extract string of size 9 each time;
output; *output;
end;
run;
*wide format;
proc transpose data=want out=wide prefix=VAR;
by Obs;
var value;
run;
proc print data=wide;
run; output proc prints The SAS System Obs myVar 1 084375EJ9084375EK6084375EL4 2 084375EJ9082375EK6084325EL4084395EJ9084395EK6084395EL4 3 074375EJ9089375EK6084335EL4 4 064375EJ9084375EK6084345EL4
... View more