cwlputz ;[ 04/14/94 11:39 AM ] ; Set Q="K" Do ^cA604 Set KLNr=0,HoofdGr="03BX ",Groep="03BX01HAV ",SubGroep="03BX01HAV01320/BL " For Set KLNr=$O(^KLPUTZ("S",KLNr)) Quit:KLNr="" Do .K ^KLPUTZ("S",KLNr,HoofdGr,Groep,SubGroep) K ^KLPUTZ("IS",HoofdGr,Groep,SubGroep) Quit .Set PRNr=0 .For Set PRNr=$O(^KLPUTZ("S",KLNr,HoofdGr,Groep,SubGroep,PRNr)) Quit:PRNr="" Do ..Set Next="" ..For Set Next=$O(^KLPUTZ("S",KLNr,HoofdGr,Groep,SubGroep,PRNr,Next)) Quit:Next="" Do ...Set R=^KLPUTZ("S",KLNr,HoofdGr,Groep,SubGroep,PRNr,Next) ...Kill ^KLPUTZ("S",KLNr,HoofdGr,Groep,SubGroep,PRNr,Next) ...Kill ^KLPUTZ("IS",HoofdGr,Groep,SubGroep,PRNr,KLNr) ...If Rec="" Set Rec=R,$P(Rec,D,4)=PRNr,$P(Rec,D,9)=+$H_";CW" ...If $P(Rec,D)+$P(Rec,D,2)>($P(R,D)+$P(R,D,2)) Do ....Set $P(Rec,D)=$P(R,D),$P(Rec,D,2)=$P(R,D,2),$P(Rec,D,4)=PRNr .Quit:Rec="" .Write !,KLNr," ",Rec .Set ^KLPUTZ("S",KLNr,HoofdGr,Groep,SubGroep,0,0)=Rec .Set ^KLPUTZ("IS",HoofdGr,Groep,SubGroep,0,KLNr)="" Quit ;