Im having trouble with a dataset. There is a free form character variable spread over multiple lines. I want to put this variable into new variables so each observation is on its own line
Heres an example dataset
data have;
input ob_ref $ chardata $ linenum 3.;
datalines;
321A MyName 1
321A John 2
431A MyName 1
431A NotJohn 2
431A ItsFred 3
511A Geoff 1
754A Cam 1
;
There is an ob_ref for each observation and I have a linenum variable indicating how many lines the observations data is spread over. I need a new dataset with one observation per line and the character variable spread over multiple variables. The maximum linenum is 56
Any help is greatly appreciated