Hello, The first data step determines the number of the variables (times / intensity) which the data set will contain, while the second step imports the values within the data set. data _null_; input @5 tmins & $30.; x=(length(strip(compress(tmins,,'d')))+1)/2; if _N_=1 then call symputx('nrvar',x); else if x gt input(symget('nrvar'),best12.) then call symputx('nrvar',x);; datalines; 1,m,1,45,5,2,5,3 2,m,3,6,5,5,6,3 3,m,6,65,5,2,20,3,23,63 4,m,9,6,5,43,5,3 5,m,3,195,5,2,5,32,34,78,12,42 6,m,6,92,5,232,5,23 ; run; data have (drop=rowvar i tmins); infile datalines dsd; *VARIABLES; input subject sex $ tmins & $30. @ ; array times{&nrvar}; array intens{&nrvar}; *Computation; rowvar=length(strip(compress(tmins,,'d')))+1;*number of commas in order to determin the loop; do i=1 to rowvar/2; times{i}=input(scan(tmins,i,","),best12.);*in order to avoid the note within the log; intens{i}=input(scan(tmins,i+rowvar/2,","),best12.); end; datalines; 1,m,1,45,5,2,5,3 2,m,3,6,5,5,6,3 3,m,6,65,5,2,20,3,23,63 4,m,9,6,5,43,5,3 5,m,3,195,5,2,5,32,34,78,12,42 6,m,6,92,5,232,5,23 ; run;
... View more