Hi:
Of course, you could use TRANSLATE, TRANWRD, or COMPRESS functions to disappear away the [ ] before you start, but you can do it all with the SCAN function too. Here's an example:
data showit;
text='[1/2/3/4]';
x1 = scan(text,1,'[/');
x2 = scan(text,2,'/');
x3 = scan(text,3,'/');
x4 = scan(text,4,'/]');
putlog _all_;
run;
Using an ARRAY and a DO loop just makes the program more elegant, however, I wanted to provide proof of concept here, not elegance.
Hope this helps,
cynthia
... View more