Hi:
Have you looked at the SCAN function???? If the numbers are -reliably- delimited by ',' (comma), then I'd recommend SCAN...probably inside a do loop. I treated the initial "line" of comma separated data as a character string and then used the SCAN function to split out the numbers. Automatic conversion took place from character to numeric -- which you may want to further control with an INPUT function in the assignment statement. But for a simple example, I didn't bother with an INPUT. I also only showed the comma as a delimiter for the SCAN -- it has a set of defaults that it would otherwise use. You can find those in the doc. The only downside to SCAN that I can think of is that 2 contiguous delimiters would be treated as 1 delimiter.
If you already have the data in a character variable, then SCAN is what I'd recommend.
If you have the data in a CSV file and want to READ the data into SAS, then I'd recommend using the delimiter= option on the infile statement. Both techniques are shown below.
cynthia
[pre]
**1) Use SCAN function on character string of numbers delimited by commas;
data parse_nums;
length nline $100;
infile datalines;
input nline $;
return;
datalines;
1,2,3
1,4,5
1,5,7
3,10
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
;
run;
data separate;
set parse_nums;
array sv num1-num20;
do i = 1 to dim(sv);
sv(i) = scan(nline,i,',');
end;
run;
proc print data=separate;
run;
**2) READ data into numeric vars;
data read_nums;
infile datalines delimiter=',' missover;
input var1-var20;
return;
datalines;
1,2,3
1,4,5
1,5,7
3,10
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
;
run;
proc print data=read_nums;
run;
[/pre]