Hi everyone, I have a question about loop. Here I have a sample data set:
data sample;
input stkcd $ ViolationYear $30.;
datalines;
000003 2001
000004 2008,2009,2010
000007 2011,2012,2013,2014
;
run;
I want to split the year in ViolationYear and rearrange to be like one stkcd match one ViolationYear liike:
000003 2001
000004 2008
000004 2009
000004 2010
000007 2011
000007 2012
and so on.
I am wondering if I can use a loop to achieve this or is there any other better choice? Looking forward to your suggestions.
Best
... View more