You could try this also:
data _null_;
S='AAAA AAAA AAAA AAA AAAAA AAAAAA, AAAAA AAAA AAAAAAAAAAAAA BBB BBBBB BBBBB BBBBB BBBBBB BBBBB BBBBBBB BBBBBBBBBBBB CCCCCCC CCCCC CCCCCCC CCCCCCC CCCCC CCCC CCCCCCCCCC DDDD DDDDD DDDD DDDDDDD DDDDD DDDDDDDD DDDD DDDDD DDDDDD DDDDD DDDD';
I1=1*55+index(substr(S,55),' ')-1; /* 1st split starting at 55 */
I2=2*55+index(substr(S,2*55),' ')-1; /* 2nd split starting at 2x55 */
I3=3*55+index(substr(S,3*55),' ')-1; /* 3rd split starting at 3x55 */
VAR1=substr(S,1,I1);
VAR2=substr(S,I1,I2-I1);
VAR3=substr(S,I2,I3-I2);
VAR4=substr(S,I3);
/* result */
put VAR1=;
put VAR2=;
put VAR3=;
put VAR4=;
run;
Greetings from Portugal.
Daniel Santos at www.cgd.pt
... View more