Hi Novinisrin and Ballardw ! Thanks for your time and help. I've tested your scripts and they work fine in sandbox but not on live for a reason I can't find. The closest result was with ballardw script, in witch the result was working fine but only on individuals that started with a "true" YN variable. It would drop the individuals starting with a "false" statement, except the very first individual SUBJID="3". The script I executed and the output : 1998 data work.want;
1999 set work.have;
2000 by notsorted SUBJID notsorted CMYN;
2001 retain flag;
2002 if first.name then flag=(CMYN='false');
2003 else do;
2004 if flag and (CMYN='false') then delete;
2005 else flag = (CMYN='false');
2006 end;
2007 run;
NOTE: Variable first.name non initialisée.
NOTE: There were 28 observations read from the data set WORK.HAVE.
NOTE: The data set WORK.WANT has 5 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds It's weird because the script is working fine on sandbox data, whatever combinaison I try. Thanks again for your time ! EDIT : I just realised first. function has "name" as parameter.. that was the problem. Your scripts are working fine ! I'm still learning haha. Thanks for your help !
... View more