First step would be to read the data into a SAS data set. Once you have done that, show us what it looks like and we'll find a way to get rid of those pesky dups.
It looks some thing like this
machine1. Start1. end1. Machine2. Start2. end2. Machine3. Start3. End3
A1. 11/01/15 11:21. 11/01/15 11:38. A1. 11/01/15 11:30 11/01/15 11:35. A1 11/01/15 11:21. 11/01/15 11:38
sometimes there are up to 5 machines but normally there are 3 what I need is to remove the duplicates and keep one of the two....
Thanks
data want;
set have;
array m{*} machine: ;
array s{*} Start: ;
array e{*} end: ;
do i=1 to dim(m);
ma=m{i};
st=s{i};
en=e{i};
output;
end;
drop machine: Start: end: ;
run;
proc sort data=want nodupkey ; by ma st en; run;
data have;
input machine1 $ ( Start1 end1) (& anydtdtm.) Machine2 $ (Start2 end2) (& anydtdtm.) Machine3 $ (Start3 End3) (& anydtdtm.);
format _numeric_ datetime.;
cards;
A1 11/01/15 11:21 11/01/15 11:38 A1 11/01/15 11:30 11/01/15 11:35 A1 11/01/15 11:21 11/01/15 11:38
A1 11/01/15 11:21 11/01/15 11:38 A1 11/01/15 11:30 11/01/15 11:35 A2 11/01/15 11:21 11/01/15 11:38
;
run;
data want;
if _n_ eq 1 then do;
length _machine $ 100 _Start _end 8;
declare hash h();
declare hiter hi('h');
h.definekey('_machine','_Start','_end');
h.definedata('_machine','_Start','_end');
h.definedone();
end;
set have;
array m{*} machine: ;
array s{*} Start: ;
array e{*} end: ;
do i=1 to dim(m);
_machine=m{i};_Start=s{i};_end=e{i};
h.replace();
end;
call missing(of m{*} s{*} e{*});
i=0;
do while(hi.next()=0);
i+1;
m{i}=_machine;s{i}=_Start;e{i}=_end;
end;
h.clear();
drop _: i ;
run;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.